From 0b4637b8152d7d293202b5ef204941b1428cecd6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 3 May 2016 18:58:57 +0000 Subject: [PATCH] Bug 16436 - Allow action logs to be logged to the koha log file Test Plan: 1) Ensure that your Koha::Logger configuration is in good working order 2) Apply this patch 3) Modify the first line of your log4perl.conf file from: log4perl.logger.intranet = WARN, INTRANET to log4perl.logger.intranet = INFO, INTRANET 4) Change a system preference setting 5) Note the new line in your log file! --- C4/Log.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C4/Log.pm b/C4/Log.pm index de5f1d0..f8a1bfd 100644 --- a/C4/Log.pm +++ b/C4/Log.pm @@ -26,6 +26,7 @@ use warnings; use C4::Context; use Koha::DateUtils; +use Koha::Logger; use vars qw(@ISA @EXPORT); @@ -77,6 +78,9 @@ sub logaction { my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)"); $sth->execute($usernumber,$modulename,$actionname,$objectnumber,$infos); $sth->finish; + + my $logger = Koha::Logger->get( { interface => 'intranet', category => "ActionLogs.$modulename.$actionname" } ); + $logger->info( "ACTION LOG: " . Data::Dumper::Dumper( { user => $usernumber, module => $modulename, action => $actionname, object => $objectnumber, info => $infos } ) ); } =item cronlogaction -- 2.1.4