Bugzilla – Attachment 45825 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]
Bug 15253 - Log stderr via Koha::Logger as well
Bug-15253---Log-stderr-via-KohaLogger-as-well.patch (text/plain), 1.67 KB, created by
Kyle M Hall (khall)
on 2015-12-18 14:00:38 UTC
(
hide
)
Description:
Bug 15253 - Log stderr via Koha::Logger as well
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-12-18 14:00:38 UTC
Size:
1.67 KB
patch
obsolete
>From 227e934901d9076cbbf865cdd415816b05430900 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 > >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. >--- > C4/SIP/SIPServer.pm | 3 ++- > C4/SIP/Trapper.pm | 21 +++++++++++++++++++++ > 2 files changed, 23 insertions(+), 1 deletion(-) > create mode 100644 C4/SIP/Trapper.pm > >diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm >index c552a68..14d3d07 100755 >--- a/C4/SIP/SIPServer.pm >+++ b/C4/SIP/SIPServer.pm >@@ -6,7 +6,6 @@ use warnings; > use FindBin qw($Bin); > use lib "$Bin"; > use Sys::Syslog qw(syslog); >-use Koha::Logger; > use Net::Server::PreFork; > use IO::Socket::INET; > use Socket qw(:DEFAULT :crlf); >@@ -19,6 +18,8 @@ use C4::SIP::Sip::MsgType qw( handle login_core ); > use C4::SIP::Sip qw( read_SIP_packet ); > > 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; >-- >1.7.10.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