[Bug 16312] New: Koha::Logger overload configuration for command line scripts verbosity levels
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Bug ID: 16312 Summary: Koha::Logger overload configuration for command line scripts verbosity levels Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: olli-antti.kivilahti@jns.fi QA Contact: testopia@bugs.koha-community.org To be able to set the -v|--verbose flags from the command line and still use Koha::Logger, we must be able to overload/extend default appenders and log levels on a easy case-by-case basis directly from the Perl-code. To deploy verbose mode in a commandline script, add the following code to your cronjob/script: use C4::Context; use Koha::Logger; C4::Context->setCommandlineEnvironment(); Koha::Logger->setConsoleVerbosity( 1 || -3 || 'WARN' || ... ); See attached tests and perldoc for more info. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |olli-antti.kivilahti@jns.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 50471 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50471&action=edit Bug 16312 - Koha::Logger overload configuration for command line scripts verbosity levels To be able to set the -v|--verbose flags from the command line and still use Koha::Logger, we must be able to overload/extend default appenders and log levels on a easy case-by-case basis directly from the Perl-code. To deploy verbose mode in a commandline script, add the following code to your cronjob/script: use C4::Context; use Koha::Logger; C4::Context->setCommandlineEnvironment(); Koha::Logger->setConsoleVerbosity( 1 || -3 || 'WARN' || ... ); The module using the Koha::Logger must lazyLoad the module/package-level logger using Koha::Logger->new(), so the overloads can be deployed. See attached tests and perldoc for more info. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14167 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14167 [Bug 14167] Add Koha::Logger based on Log4perl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |16302, 16304 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16302 [Bug 16302] Koha::Logger performance tests https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16304 [Bug 16304] Koha::Logger, lazy load loggers so environment has time to get set -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |16303 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16303 [Bug 16303] Koha::Logger appenders for interfaces 'commandline' and 'sip2' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50471|0 |1 is obsolete| | --- Comment #2 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 50472 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50472&action=edit Bug 16312 - Koha::Logger overload configuration for command line scripts verbosity levels To be able to set the -v|--verbose flags from the command line and still use Koha::Logger, we must be able to overload/extend default appenders and log levels on a easy case-by-case basis directly from the Perl-code. To deploy verbose mode in a commandline script, add the following code to your cronjob/script: use C4::Context; use Koha::Logger; C4::Context->setCommandlineEnvironment(); Koha::Logger->setConsoleVerbosity( 1 || -3 || 'WARN' || ... ); The module using the Koha::Logger must lazyLoad the module/package-level logger using Koha::Logger->new(), so the overloads can be deployed. See attached tests and perldoc for more info. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |16313 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16313 [Bug 16313] Koha::Logger doesn't forward the Log::Log4perl::Logger return value -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #50472|0 |1 is obsolete| | --- Comment #3 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 50495 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50495&action=edit Bug 16312 - Koha::Logger overload configuration for command line scripts verbosity levels To be able to set the -v|--verbose flags from the command line and still use Koha::Logger, we must be able to overload/extend default appenders and log levels on a easy case-by-case basis directly from the Perl-code. To deploy verbose mode in a commandline script, add the following code to your cronjob/script: use C4::Context; use Koha::Logger; C4::Context->setCommandlineEnvironment(); Koha::Logger->setConsoleVerbosity( 1 || -3 || 'WARN' || ... ); The module using the Koha::Logger must lazyLoad the module/package-level logger using Koha::Logger->new(), so the overloads can be deployed. See attached tests and perldoc for more info. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 Bug 16312 depends on bug 16303, which changed state. Bug 16303 Summary: Koha::Logger appenders for interfaces 'commandline' and 'sip2' https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16303 What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |RESOLVED Resolution|--- |DUPLICATE -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org