Bugzilla – Attachment 77532 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: (follow-up) Use Koha::Logger and add fatal errors
Bug-16357-follow-up-Use-KohaLogger-and-add-fatal-e.patch (text/plain), 1.83 KB, created by
Jonathan Druart
on 2018-08-07 14:02:25 UTC
(
hide
)
Description:
Bug 16357: (follow-up) Use Koha::Logger and add fatal errors
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-08-07 14:02:25 UTC
Size:
1.83 KB
patch
obsolete
>From b259476752810c3522a39c1ea8a1f8f6b27bb5d3 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Wed, 28 Feb 2018 14:51:55 +0200 >Subject: [PATCH] Bug 16357: (follow-up) Use Koha::Logger and add fatal errors > >--- > debian/templates/plack.psgi | 12 +++++------- > etc/log4perl.conf | 7 +++++++ > 2 files changed, 12 insertions(+), 7 deletions(-) > >diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi >index 90d4a266aa..2c65dc7996 100644 >--- a/debian/templates/plack.psgi >+++ b/debian/templates/plack.psgi >@@ -38,13 +38,11 @@ use Koha::Database; > use Koha::DateUtils; > > #BZ 16357, add timestamps to warnings >-use Log::Log4perl qw(:easy); >-Log::Log4perl->easy_init({ level => $WARN, utf8 => 1 }); >-my $logger = Log::Log4perl->get_logger(); # use the default logger style >-$SIG{__WARN__} = sub { >- my $message = shift; >- $logger->warn($message); >-}; >+use Koha::Logger; >+ >+my $logger = Koha::Logger->get({ interface => 'plack-error' }); >+$SIG{__WARN__} = sub { $logger->warn(shift); }; >+$SIG{__DIE__} = sub { $logger->fatal(shift); }; > > use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise > { >diff --git a/etc/log4perl.conf b/etc/log4perl.conf >index efc470746a..bcf81597b2 100644 >--- a/etc/log4perl.conf >+++ b/etc/log4perl.conf >@@ -11,3 +11,10 @@ log4perl.appender.OPAC.filename=__LOG_DIR__/opac-error.log > log4perl.appender.OPAC.mode=append > log4perl.appender.OPAC.layout=PatternLayout > log4perl.appender.OPAC.layout.ConversionPattern=[%d] [%p] %m %l %n >+ >+log4perl.logger.plack-error = WARN, PLACK-ERROR >+log4perl.appender.PLACK-ERROR=Log::Log4perl::Appender::File >+log4perl.appender.PLACK-ERROR.filename=__LOG_DIR__/plack-error.log >+log4perl.appender.PLACK-ERROR.mode=append >+log4perl.appender.PLACK-ERROR.layout=PatternLayout >+log4perl.appender.PLACK-ERROR.layout.ConversionPattern=[%d] [%p] %m >-- >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