Skip to content

Conditional logging per model? #248

Answered by palkan
wiegand asked this question in Q&A
Discussion options

You must be logged in to vote

Since Logidze operates at the database-level, we cannot provide a similar model-backed feature. In your case, you may consider changing the trigger code a bit to include the type filter:

CREATE TRIGGER logidze_on_posts
BEFORE UPDATE OR INSERT ON posts FOR EACH ROW
WHEN (coalesce(current_setting('logidze.disabled', true), '') <> 'on') AND
  (NEW.type = 'audited_type')
EXECUTE PROCEDURE logidze_logger(<logidze params>);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wiegand
Comment options

Answer selected by wiegand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants