Bugzilla – Attachment 109215 Details for
Bug 16357
Plack error logs are not time stamped
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16357: Only use Log4perl middleware if appenders defined
Bug-16357-Only-use-Log4perl-middleware-if-appender.patch (text/plain), 1.93 KB, created by
David Cook
on 2020-08-26 23:23:15 UTC
(
hide
)
Description:
Bug 16357: Only use Log4perl middleware if appenders defined
Filename:
MIME Type:
Creator:
David Cook
Created:
2020-08-26 23:23:15 UTC
Size:
1.93 KB
patch
obsolete
>From 5f04e163f3f528b52d812448972e56cf5b9ed52d Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 26 Aug 2020 00:58:36 +0000 >Subject: [PATCH] Bug 16357: Only use Log4perl middleware if appenders defined > >This patch checks that the loggers used by the middleware >actually have appenders defined. > >Without this patch, if the loggers don't have appenders >defined in the log4perl file, the logs will just be lost. >--- > debian/templates/plack.psgi | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > >diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi >index 7bfb34fb68..99438c595a 100644 >--- a/debian/templates/plack.psgi >+++ b/debian/templates/plack.psgi >@@ -38,6 +38,7 @@ use Koha::Database; > use Koha::DateUtils; > use Koha::Logger; > >+use Log::Log4perl; > use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise > { > no warnings 'redefine'; >@@ -77,18 +78,24 @@ builder { > enable "+Koha::Middleware::RealIP"; > > mount '/opac' => builder { >- enable 'Log4perl', category => 'plack-opac'; >- enable 'LogWarn'; >+ if ( Log::Log4perl->get_logger('plack-opac')->has_appenders ){ >+ enable 'Log4perl', category => 'plack-opac'; >+ enable 'LogWarn'; >+ } > $opac; > }; > mount '/intranet' => builder { >- enable 'Log4perl', category => 'plack-intranet'; >- enable 'LogWarn'; >+ if ( Log::Log4perl->get_logger('plack-intranet')->has_appenders ){ >+ enable 'Log4perl', category => 'plack-intranet'; >+ enable 'LogWarn'; >+ } > $intranet; > }; > mount '/api/v1/app.pl' => builder { >- enable 'Log4perl', category => 'plack-api'; >- enable 'LogWarn'; >+ if ( Log::Log4perl->get_logger('plack-api')->has_appenders ){ >+ enable 'Log4perl', category => 'plack-api'; >+ enable 'LogWarn'; >+ } > $apiv1; > }; > }; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16357
:
71752
|
71753
|
71871
|
72290
|
72296
|
73404
|
77529
|
77530
|
77531
|
77532
|
77533
|
106141
|
106313
|
106319
|
106320
|
109053
|
109054
|
109055
|
109056
|
109060
|
109067
|
109068
|
109133
|
109215
|
110107
|
110108
|
110109
|
110249
|
110250
|
110251
|
110252
|
110253
|
110254