[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
Tue Aug 25 09:02:32 CEST 2020


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

Joonas Kylmälä <joonas.kylmala at helsinki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #77529|0                           |1
        is obsolete|                            |
  Attachment #77530|0                           |1
        is obsolete|                            |
  Attachment #77531|0                           |1
        is obsolete|                            |
  Attachment #77532|0                           |1
        is obsolete|                            |
  Attachment #77533|0                           |1
        is obsolete|                            |
 Attachment #106319|0                           |1
        is obsolete|                            |
 Attachment #106320|0                           |1
        is obsolete|                            |
 Attachment #109053|0                           |1
        is obsolete|                            |

--- Comment #67 from Joonas Kylmälä <joonas.kylmala at helsinki.fi> ---
Created attachment 109054
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109054&action=edit
Bug 16357: Override __WARN__ in Plack to use Log4Perl

This patch overrides __WARN__ in Plack to use Log4Perl to add
timestamps to error output. The Log4Perl config uses a screen
appender so the output still goes to STDERR so that it is still
managed by Starman.

This patch adds a Plack::Middleware::LogWarn package dependency.
(The dependency is very simplistic, so we could always do out own
 version if we would prefer to skip the external dependency.)

To Test:
0) apt-get install libplack-middleware-logwarn-perl
1) Apply patch
2) Copy PLACK block from etc/log4perl.conf to
/etc/koha/sites/kohadev/log4perl.conf
3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi
4) Create some output on STDERR (it might be necessary to add
a 'warn "TEST";' line to the intranet or OPAC)
5) koha-plack --restart kohadev
6) Open /var/log/koha/kohadev/plack-error.log
7) Observe a log line like the following:
[2020/06/22 03:51:23] [WARN] TEST at /kohadevbox/koha/opac/opac-user.pl line
59.

Signed-off-by: Arthur Suzuki <arthur.suzuki at biblibre.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala at helsinki.fi>

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


More information about the Koha-bugs mailing list