Bugzilla – Attachment 71752 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 - Plack error logs are not time stamped
Bug-16357---Plack-error-logs-are-not-time-stamped.patch (text/plain), 2.34 KB, created by
Mason James
on 2018-02-16 13:17:32 UTC
(
hide
)
Description:
Bug 16357 - Plack error logs are not time stamped
Filename:
MIME Type:
Creator:
Mason James
Created:
2018-02-16 13:17:32 UTC
Size:
2.34 KB
patch
obsolete
>From 6852e89fc091372428b9db77768b285b6f05e5a5 Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Sat, 17 Feb 2018 02:00:47 +1300 >Subject: [PATCH] Bug 16357 - Plack error logs are not time stamped >Content-Type: text/plain; charset="utf-8" > >to test this patch.. > >1/ start plack >$ sudo koha-plack --start mylib > >2/ tail log file, notice error log has no timestamps :( > >$ sudo tail -f /var/log/koha/mylib/plack-error.log > ... > Initiating an anonymous session... at /usr/share/koha/lib/C4/Auth.pm line 1294. > Checking Auth at /usr/share/koha/lib/C4/Auth.pm line 815. > >3/ apply patch > >4 manually copy new plack file to live location >$ sudo cp ./debian/templates/plack.psgi /etc/koha/ > >5/ restart plack >$ sudo koha-plack --restart mylib > >6/ tail log file, notice error log now has timestamps :) >$ sudo tail -f /var/log/koha/mylib/plack-error.log > ... > 2018/02/11 08:56:29 Initiating an anonymous session... at /usr/share/koha/lib/C4/Auth.pm line 1294. > 2018/02/11 08:56:33 Checking Auth at /usr/share/koha/lib/C4/Auth.pm line 815. >--- > debian/templates/plack.psgi | 9 +++++++++ > misc/plack/koha.psgi | 9 +++++++++ > 2 files changed, 18 insertions(+) > >diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi >index 3538b9a..eac3553 100644 >--- a/debian/templates/plack.psgi >+++ b/debian/templates/plack.psgi >@@ -37,6 +37,15 @@ use Koha::Cache::Memory::Lite; > use Koha::Database; > use Koha::DateUtils; > >+#BZ 16520, add timestamps to warnings >+use Log::Log4perl qw(:easy); >+Log::Log4perl->easy_init($WARN); >+my $logger = Log::Log4perl->get_logger(); # use the default logger style >+$SIG{__WARN__} = sub { >+ my $message = shift; >+ $logger->warn($message); >+}; >+ > use CGI qw(-utf8 ); # we will loose -utf8 under plack, otherwise > { > no warnings 'redefine'; >diff --git a/misc/plack/koha.psgi b/misc/plack/koha.psgi >index a66b2ec..fbd6aec 100644 >--- a/misc/plack/koha.psgi >+++ b/misc/plack/koha.psgi >@@ -5,6 +5,15 @@ use lib qw( ./lib ); > use Plack::Middleware::Debug; > use Plack::App::Directory; > >+#BZ 16520, add timestamps to warnings >+use Log::Log4perl qw(:easy); >+Log::Log4perl->easy_init($WARN); >+my $logger = Log::Log4perl->get_logger(); # use the default logger style >+$SIG{__WARN__} = sub { >+ my $message = shift; >+ $logger->warn($message); >+}; >+ > use CGI qw(-utf8 ); # we will lose -utf8 under plack > { > no warnings 'redefine'; >-- >2.1.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