Bug 14167: Add Koha::Logger based on Log4perl
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 7 May 2015 15:20:50 +0000 (11:20 -0400)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Tue, 21 Jul 2015 13:15:40 +0000 (10:15 -0300)
commita269e8ec4480732ade4f0cbcda0e1560c4c257d3
tree22527b7ee8fc4256ad3ef441b04512bc47478b3c
parentee6dced5617acb6132299f8de521c4bb38b501ea
Bug 14167: Add Koha::Logger based on Log4perl

Koha needs a better logger, and it seems like the best solution would be
to take advantage of Log4perl which is already a fully featured logger.
We use Log4perl to selectively decide what statements should be logged,
and where they should go!

Test plan:
0) Install Log::Log4perl via packages or cpan
1) Apply this patch and the example renewal patch
2) Copy etc/log4perl.conf to your koha conf directory, edit the paths
   to match your current error logs
3) Edit your koha-conf file and add the
   <log4perl_conf>/path/to/log4perl.conf</log4perl_conf> line
4) Watch your intranet and opac error logs
5) Perform a renewal via the staff interface, note there is nothing new
   in the log file
7) Update the log4perl.conf, change the log level from WARN to TRACE
   for both the staff and opac sides
8) Perform a renewal via the staff interface, note the logged lines
9) Perform a renewal via the opac, note the logged lines

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended this patch: Moved the renewal stuff to a separate example patch.
And upgraded the DEBUG level to WARN in the log4perl config file.
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
C4/Installer/PerlDependencies.pm
Koha/Logger.pm [new file with mode: 0644]
etc/koha-conf.xml
etc/log4perl.conf [new file with mode: 0644]