We define all the logging configurations for various interfaces in log4perl.conf. Interfaces log to files, and every interface can run as a different user. Every time you execute a Perl program that uses Koha::Logger and Log::Log4perl, Log::Log4perl tries to open all the filehandles in the log4perl.conf. Since different interface logs should be owned by different users, this crashes the system. Can't sysopen /home/koha/koha-dev/var/log/intranet.log (Permission denied) at /usr/local/share/perl/5.18.2/Log/Log4perl/Appender/File.pm line 120. This patch introduces lazy-loading parameters to the FileAppenders, so they open only the files they need. Koha::Logger makes sure they always use the correct log file for the interface (opac, intranet, commandline, sip, restapi, ...). log4perl.appender.CLI.syswrite=true log4perl.appender.*.create_at_logtime=true Also while working on this bug identified as a target of opportunity some useful extra parameters for the appenders. log4perl.appender.*.syswrite=true This should solve concurrency issues under multithreaded Perl-apps such as what Mojolicious should be ran as. log4perl.appender.*.recreate=true This polls the filesystem path to the logfile for changes. Eg. if logrotate of the admin might move the logfile for storage purposes, Log4perl can recreate the missing file, instead of writing to the moved file.
Created attachment 51458 [details] [review] Bug-16509-Koha-Logger-dies-when-log4perl.conf-has-Fi.patch
Olli, this patch doesn't apply to master. I think this must be dependent on another bug.
Created attachment 90944 [details] [review] Bug 16509: fix multi-owner perms, improve logrotate compatibility Rescued, because the last CLI section no longer exists.
The patch still applies, but how can I test this?
In which case do we have such situations? I am marking this as INVALID for now, as to me we should not face it with our current infrastructure. Please reopen with more details if you think it's still valid.