Bugzilla – Attachment 131433 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), 1.50 KB, created by
Marcel de Rooy
on 2022-03-07 12:57:29 UTC
(
hide
)
Description:
Bug 30242: Allow changing Mojolicious log level
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-03-07 12:57:29 UTC
Size:
1.50 KB
patch
obsolete
>From da96e24431fb280346e4e2bc7b43e7ce3fb8fb71 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 > >Just a rudimentary approach: Add a config variable to koha-conf >and set log level when calling ->startup. > >Test plan: >Add var to your koha-conf. >Hit the API. >Check your plack-error.log with/without this patch. >Toggle log level, check again. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/REST/V1.pm | 3 +++ > debian/templates/koha-conf-site.xml.in | 2 ++ > 2 files changed, 5 insertions(+) > >diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm >index 1c22a769d7..fca9affa83 100644 >--- a/Koha/REST/V1.pm >+++ b/Koha/REST/V1.pm >@@ -42,6 +42,9 @@ Overloaded Mojolicious->startup method. It is called at application startup. > sub startup { > my $self = shift; > >+ my $level = C4::Context->config('mojo_log_level') || 'warn'; >+ $self->log->level($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 6525e4ce97..2120df3a91 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -449,5 +449,7 @@ __END_SRU_PUBLICSERVER__ > <vhost>__MESSAGE_BROKER_VHOST__</vhost> > </message_broker> > >+ <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