]> git.koha-community.org Git - koha.git/commit
Bug 16357: Use separate Log4Perl logger for each Plack app
authorDavid Cook <dcook@prosentient.com.au>
Fri, 26 Jun 2020 02:25:10 +0000 (02:25 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 20 Oct 2020 14:25:55 +0000 (14:25 +0000)
commit7317493c821295d35274105ae4bbf9d566277b39
treee5d6fb6f97b9261f9b670e35849562983e2ec936
parentd8717c994ee37e298e80a4c0e4f83c35c6c62b9a
Bug 16357: Use separate Log4Perl logger for each Plack app

This patch creates separate timestamped Log4Perl loggers
for each Plack app, so that the Intranet, OPAC, and API are logged
to separate files.

To Test:
0) apt-get install libplack-middleware-logwarn-perl
1) Apply "Alternative" patches
2) Copy PLACK block from etc/log4perl.conf to
/etc/koha/sites/kohadev/log4perl.conf and replace __LOG_DIR__ appropriately
3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi
4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl
5) koha-plack --restart kohadev
6) Go to /cgi-bin/koha/mainpage.pl and /cgi-bin/koha/opac-main.pl
7) Open /var/log/koha/kohadev/plack-opac-error.log and
/var/log/koha/kohadev/plack-intranet-error.log
7) Observe a log line like the following:
[2020/06/22 03:51:23] [WARN] TEST at <SCRIPT and line #>.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ef021268bbe9519ac3eb070450591c2b761ac1c3)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
debian/templates/log4perl-site.conf.in
debian/templates/plack.psgi
etc/log4perl.conf