@@ -, +, @@ --- Koha/Logger.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/Koha/Logger.pm +++ a/Koha/Logger.pm @@ -118,18 +118,19 @@ sub DESTROY { } sub _init { - my $log4perl_config_filepath = + #my $env_LOG4PERL_CONF = exists $ENV{LOG4PERL_CONF} ? $ENV{LOG4PERL_CONF} : undef; + my $log4perl_config = exists $ENV{"LOG4PERL_CONF"} - and $ENV{'LOG4PERL_CONF'} - and -s $ENV{"LOG4PERL_CONF"} + && $ENV{'LOG4PERL_CONF'} + && -s $ENV{"LOG4PERL_CONF"} # Check for web server level configuration first # In this case we ASSUME that you correctly arranged logfile # permissions. If not, log4perl will crash on you. - ? Log::Log4perl->init_once( $ENV{"LOG4PERL_CONF"} ); + ? $ENV{"LOG4PERL_CONF"} : C4::Context->config("log4perl_conf"); # This will explode with the relevant error message if something is wrong in the config file - return Log::Log4perl->init_once($conf); + return Log::Log4perl->init_once($log4perl_config); } sub _recheck_logfile { # recheck saved logfile when logging message --