Bugzilla – Attachment 139759 Details for
Bug 30242
REST API: Allow configuring log level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30242: Allow changing Mojolicious log level
Bug-30242-Allow-changing-Mojolicious-log-level.patch (text/plain), 2.22 KB, created by
Marcel de Rooy
on 2022-08-25 09:42:05 UTC
(
hide
)
Description:
Bug 30242: Allow changing Mojolicious log level
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-08-25 09:42:05 UTC
Size:
2.22 KB
patch
obsolete
>From 79df16849e55441409a16cbf1dfbaa1355d0f37e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 7 Mar 2022 12:55:24 +0000 >Subject: [PATCH] Bug 30242: Allow changing Mojolicious log level >Content-Type: text/plain; charset=utf-8 > >Add an optional config variable to koha-conf and set log level in >sub startup. > >Test plan: >Check last line of plack-error.log. >Hit the REST API. >When you have a dev_install, you should see new log line(s). >For a regular install, there may be no new log lines. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/REST/V1.pm | 4 ++++ > debian/templates/koha-conf-site.xml.in | 5 +++++ > etc/koha-conf.xml | 5 +++++ > 3 files changed, 14 insertions(+) > >diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm >index 62d326e0fd..3a7b69271e 100644 >--- a/Koha/REST/V1.pm >+++ b/Koha/REST/V1.pm >@@ -43,6 +43,10 @@ Overloaded Mojolicious->startup method. It is called at application startup. > sub startup { > my $self = shift; > >+ my $log_level = C4::Context->config('mojo_log_level') || >+ ( C4::Context->config('dev_install') ? 'trace' : 'info' ); >+ $self->log->level($log_level); >+ > $self->hook( > before_dispatch => sub { > my $c = shift; >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index 29b378bc70..d55fcd30db 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -462,5 +462,10 @@ __END_SRU_PUBLICSERVER__ > <do_not_remove_cookie>KohaOpacLanguage</do_not_remove_cookie> > --> > >+ <!-- Uncomment next line to configure mojo log level (REST API). >+ By default, trace for dev installs and info otherwise. >+ <mojo_log_level>warn</mojo_log_level> >+ --> >+ > </config> > </yazgfs> >diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml >index 0d0c50ea24..5c89ddafbf 100644 >--- a/etc/koha-conf.xml >+++ b/etc/koha-conf.xml >@@ -278,5 +278,10 @@ > <do_not_remove_cookie>KohaOpacLanguage</do_not_remove_cookie> > --> > >+ <!-- Uncomment next line to configure mojo log level (REST API). >+ By default, trace for dev installs and info otherwise. >+ <mojo_log_level>warn</mojo_log_level> >+ --> >+ > </config> > </yazgfs> >-- >2.20.1
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 30242
:
131433
|
139759
|
139760