Bugzilla – Attachment 85711 Details for
Bug 18205
Use Koha::Logger/Log4Perl using Mojolicious app log method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18205: Add interface 'rest' for Koha::Logger
Bug-18205-Add-interface-rest-for-KohaLogger.patch (text/plain), 2.26 KB, created by
Josef Moravec
on 2019-02-26 12:16:36 UTC
(
hide
)
Description:
Bug 18205: Add interface 'rest' for Koha::Logger
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-02-26 12:16:36 UTC
Size:
2.26 KB
patch
obsolete
>From cbfa57d66008c1df215521c342182c1200a3d8b7 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Fri, 3 Mar 2017 15:38:34 +0200 >Subject: [PATCH] Bug 18205: Add interface 'rest' for Koha::Logger > >This patch adds an interface 'rest' for Koha::Logger. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Context.pm | 3 ++- > Koha/REST/V1.pm | 2 ++ > etc/log4perl.conf | 10 ++++++++++ > 3 files changed, 14 insertions(+), 1 deletion(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index 9b3f74dbb2..50de0b4109 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -1028,7 +1028,8 @@ sub interface { > > if (defined $interface) { > $interface = lc $interface; >- if ($interface eq 'opac' || $interface eq 'intranet' || $interface eq 'sip' || $interface eq 'commandline') { >+ if ($interface eq 'opac' || $interface eq 'intranet' || $interface eq 'sip' || >+ $interface eq 'commandline' || $interface eq 'rest' ) { > $context->{interface} = $interface; > } else { > warn "invalid interface : '$interface'"; >diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm >index df327e9c55..fee6a7c967 100644 >--- a/Koha/REST/V1.pm >+++ b/Koha/REST/V1.pm >@@ -37,6 +37,8 @@ Overloaded Mojolicious->startup method. It is called at application startup. > sub startup { > my $self = shift; > >+ C4::Context->interface('rest'); >+ > # Remove /api/v1/app.pl/ from the path > $self->hook( before_dispatch => sub { > shift->req->url->base->path('/'); >diff --git a/etc/log4perl.conf b/etc/log4perl.conf >index efc470746a..b64d3c7102 100644 >--- a/etc/log4perl.conf >+++ b/etc/log4perl.conf >@@ -11,3 +11,13 @@ 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.rest = WARN, REST >+log4perl.appender.REST=Log::Log4perl::Appender::File >+log4perl.appender.REST.filename=__LOG_DIR__/rest.log >+log4perl.appender.REST.create_at_logtime=true >+log4perl.appender.REST.syswrite=true >+log4perl.appender.REST.recreate=true >+log4perl.appender.REST.mode=append >+log4perl.appender.REST.layout=PatternLayout >+log4perl.appender.REST.layout.ConversionPattern=[%d] [%p] %m %l %n >-- >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 18205
:
60848
|
60849
|
60850
|
69226
|
69227
|
69228
|
69232
|
85711
|
85712
|
85713
|
85714
|
87537
|
87538
|
87539
|
87540
|
87541
|
87542
|
87545
|
139811