Bugzilla – Attachment 72290 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), 2.59 KB, created by
Lari Taskula
on 2018-02-28 12:56:02 UTC
(
hide
)
Description:
Bug 16357: (follow-up) Use Koha::Logger and add fatal errors
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2018-02-28 12:56:02 UTC
Size:
2.59 KB
patch
obsolete
>From 46a6bb10e664b2f1f21598078a0636aa8ce5e5e4 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 +++++++ > misc/plack/koha.psgi | 12 +++++------- > 3 files changed, 17 insertions(+), 14 deletions(-) > >diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi >index 90d4a26..2c65dc7 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 efc4707..bcf8159 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 >diff --git a/misc/plack/koha.psgi b/misc/plack/koha.psgi >index 8f87dfb..a7989f5 100644 >--- a/misc/plack/koha.psgi >+++ b/misc/plack/koha.psgi >@@ -6,13 +6,11 @@ use Plack::Middleware::Debug; > use Plack::App::Directory; > > #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 lose -utf8 under plack > { >-- >2.7.4
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