[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:58:49 CEST 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18205
--- Comment #31 from David Cook <dcook at prosentient.com.au> ---
(In reply to David Cook from comment #30)
> Easy peasy lemon squeezy.
Ok it was slightly different.
Koha/REST/V1.pm:
sub startup {
my $self = shift;
+ my $logger = Koha::Logger->get({ interface => 'api' });
+ $self->log($logger);
+
Koha/REST/V1/Libraries.pm:
sub list {
my $c = shift->openapi->valid_input or return;
+ $c->app->log->debug('DEBUG');
+ $c->app->log->warn('WARN');
--
Since /etc/koha/sites/kohadev/log4perl.conf has "api" set to "WARN", only the
WARN gets printed out in /var/log/koha/kohadev/api-error.log:
[2022/08/25 23:55:01] [WARN] WARN Koha::REST::V1::Libraries::list
/kohadevbox/koha/Koha/REST/V1/Libraries.pm (46)
[2022/08/25 23:55:41] [WARN] WARN Koha::REST::V1::Libraries::list
/kohadevbox/koha/Koha/REST/V1/Libraries.pm (46)
[2022/08/25 23:55:43] [WARN] WARN Koha::REST::V1::Libraries::list
/kohadevbox/koha/Koha/REST/V1/Libraries.pm (46)
I'll submit a patch momentarily...
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list