[Koha-bugs] [Bug 16357] Plack error logs are not time stamped

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Sep 2 03:11:12 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357

--- Comment #46 from David Cook <dcook at prosentient.com.au> ---
I have some thoughts on this one.

Firstly, why are we using Log::Log4perl::Appender::File at all? It doesn't make
sense, unless you're going to be logging to custom files independent of your
webserver. Since we're already leveraging the log file directives of Apache or
Starman and expecting to use their log files, let's just use
Log::Log4perl::Appender::Screen and set log4perl.appender.Screen.stderr = 1 to
log to STDERR. Easy as. Then the log files would be handled automagically by
the web servers.

If we, for some reason, must use Log::Log4perl::Appender::File, then let's use
application-specific webserver-independent log files. 

So that's probably what we *should* do. Let's look at what we're currently
doing...

--

Looking at /etc/logrotate.d/koha-common, it looks like "sharedscripts" will
imply "create" which in the absence of configuration will use the existing file
attributes. That explains why the rotated log files are the same as the ones
that came before them. (The only issue there would be if you switched from
Apache to Plack and didn't chmod the files in the process I suppose.)

I took a look at ./etc/log4perl.conf and
./debian/templates/log4perl-site.conf.in, and it looks like the defaults are
the Apache logs. 

I suppose that is technically OK if Apache is running Koha as a set of CGI
scripts, but really doesn't make sense if you're running Koha as a PSGI app.

--

In summary, I think the issue is with our Log4Perl default configuration, and
not a permissions issue per se. 

I'm looking at a Koha running Plack at the moment, and it looks like the
Log4Perl appenders aren't even used. I'm guessing that they silently fail since
the Starman user can't write to the root owned Apache files. 

--

Alas, I don't have time to work on this, but that's my 2 cents. I'd say the
easiest solution is to change to Log::Log4perl::Appender::Screen and set
log4perl.appender.Screen.stderr = 1, and then not worry about managing the log
files outside the web servers.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list