Bug 14167: (QA followup) Making Koha::Logger bit more crash resistant
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 26 Jun 2015 12:12:20 +0000 (14:12 +0200)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Tue, 21 Jul 2015 13:18:50 +0000 (10:18 -0300)
commit347d12c41f9ebe638a844b059df5523975e1867d
tree5958a33acfbf1fb72e94da5502334f40e8155283
parent25df3abb22e6f36ed80e8510f1e3b9f2150f1b2c
Bug 14167: (QA followup) Making Koha::Logger bit more crash resistant

Moving the BEGIN block to _init for the most part. We only need to
initialize when we actually start using the logger.
Removed the third init part. If we do not have a log4perl_conf in the
koha config, we are not using it yet.
Method get uses hash parameters now. It calls init. If we do not have a
config or the logfile is not writable, we will not use log4perl.
Using AUTOLOAD as a wrapper around Log4perl in order to add some checks
that log4perl does not have.
If a logrotate would change file permissions on a default logfile, we
should catch that now too (see recheck).

Test plan:
Run the previous tests again.
Will still add a unit test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Koha/Logger.pm