Bugzilla – Attachment 71703 Details for
Bug 15253
Add Koha::Logger based logging for SIP2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[2nd PATCH] Bug 15253 - Log stderr via Koha::Logger as well
Bug-15253---Log-stderr-via-KohaLogger-as-well.patch (text/plain), 1.56 KB, created by
Marcel de Rooy
on 2018-02-16 07:05:33 UTC
(
hide
)
Description:
[2nd PATCH] Bug 15253 - Log stderr via Koha::Logger as well
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-02-16 07:05:33 UTC
Size:
1.56 KB
patch
obsolete
>From 8fe267260de7813c541e2b77404d2c9e0337c8cd Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 18 Dec 2015 13:18:12 +0000 >Subject: [PATCH] Bug 15253 - Log stderr via Koha::Logger as well >Content-Type: text/plain; charset=utf-8 > >By logging stderr to the log file, we can much more easily find >and debug errors in the SIP server. Stderr has its own category >STDERR so these messages can easily be filtered out of the log >if need be. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/SIP/SIPServer.pm | 2 ++ > C4/SIP/Trapper.pm | 21 +++++++++++++++++++++ > 2 files changed, 23 insertions(+) > create mode 100644 C4/SIP/Trapper.pm > >diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm >index c565c44..a96264a 100755 >--- a/C4/SIP/SIPServer.pm >+++ b/C4/SIP/SIPServer.pm >@@ -18,6 +18,8 @@ use C4::SIP::Sip::Checksum qw(checksum verify_cksum); > use C4::SIP::Sip::MsgType qw( handle login_core ); > > use Koha::Logger; >+use C4::SIP::Trapper; >+tie *STDERR, "C4::SIP::Trapper"; > > use base qw(Net::Server::PreFork); > >diff --git a/C4/SIP/Trapper.pm b/C4/SIP/Trapper.pm >new file mode 100644 >index 0000000..0a2b872 >--- /dev/null >+++ b/C4/SIP/Trapper.pm >@@ -0,0 +1,21 @@ >+package C4::SIP::Trapper; >+ >+use Modern::Perl; >+ >+use Koha::Logger; >+ >+sub TIEHANDLE { >+ my $class = shift; >+ bless [], $class; >+} >+ >+sub PRINT { >+ my $self = shift; >+ $Log::Log4perl::caller_depth++; >+ my $logger = Koha::Logger->get({ interface => 'sip', category => 'STDERR' }); >+ warn @_; >+ $logger->error(@_); >+ $Log::Log4perl::caller_depth--; >+} >+ >+1; >-- >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 15253
:
45824
|
45825
|
45826
|
58570
|
58571
|
58572
|
58573
|
58582
|
60872
|
65219
|
65220
|
65221
|
65222
|
65223
|
65224
|
65225
|
65226
|
65227
|
65228
|
71702
|
71703
|
74947
|
86573
|
86574
|
87993
|
88383
|
100062
|
100063
|
100379
|
102216
|
102217
|
102218
|
102219
|
103456
|
103457
|
103458
|
103459
|
103462
|
103499
|
103500
|
103501
|
103502
|
103503
|
103599
|
103915
|
103916
|
103917
|
103918
|
103919
|
103920
|
103921
|
104016
|
104667
|
104668
|
104669
|
104670
|
104671
|
104672
|
104673
|
104674
|
111169