From 59ae9643e0beb408b779f615c9637257dd396ccb Mon Sep 17 00:00:00 2001 From: Jared Johnson Date: Tue, 2 Dec 2014 16:51:51 -0600 Subject: [PATCH] Add config to enable content log, on by default --- plugins/content_log | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/content_log b/plugins/content_log index 48f1567..2c9ceca 100644 --- a/plugins/content_log +++ b/plugins/content_log @@ -5,7 +5,15 @@ use POSIX qw:strftime:; -sub hook_data_post { +sub register { + my ( $self, $qp ) = @_; + my $enabled = $qp->config('enable_content_log'); + $enabled = 'true' if ! defined $enabled; + return if lc($enabled) ne 'true'; + $self->register_hook('data_post', 'data_post_handler'); +} + +sub data_post_handler { my ($self, $transaction) = @_; open my $out, '>>', $self->content_log_file;