[Koha-bugs] [Bug 18205] API interface to Koha::Logger

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 26 01:46:53 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18205

David Cook <dcook at prosentient.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcook at prosentient.com.au

--- Comment #30 from David Cook <dcook at prosentient.com.au> ---
Some of this will be obsolete due to bug 16357.

So $c->app->log uses Mojo::Log, which outputs to STDERR. It uses log level
"trace" in dev or "info" in prod, or the env var MOJO_LOG_LEVEL
(https://docs.mojolicious.org/Mojolicious#log)

We're already catching STDERR and putting it through log4perl, so I think the
only issue right now would be the discrepancy between the log level of the
Mojo::Log object and the log level defined in the log4perl configuration. (That
is, log4perl might say only output "WARN" and above, whereas currently a
$c->log->debug('debug') would still be printed out to the log4perl log.

(In reply to Martin Renvoize from comment #25)
> Why not simply do $app->log(Koha::Logger->get) and use the config and setup
> afforded to us by the existing work within Koha::Logger..

So I'd say Martin's suggestion is the correct solution. 

In Koha/REST/V1.pm, we'd just need to do $self->log( Koha::Logger->get({
interface => 'api' }) ) in the startup() function.

Easy peasy lemon squeezy.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list