[Bug 16313] New: Koha::Logger doesn't forward the Log::Log4perl::Logger return value
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16313 Bug ID: 16313 Summary: Koha::Logger doesn't forward the Log::Log4perl::Logger return value 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 Log::Log4perl::Logger->$method returns undef if the log level is not logged or something bad happened and true or something similar on success. This allows chaining different loggers to trigger if Log4perl failed to log. Koha::Logger is hardwired to return 1 if Log4perl is configured properly regardless of whether the Log4perl actually succeeded in printing the log message. This is a Log4perl best practice: $Koha::Logger->debug() or syslog("LOG_DEBUG", ...); which should revert to syslog() to log if Log4perl cannot for some reason do the logging. (eg. is disabled) This patch makes the Koha::Logger work with Log4perl better in tandem and return the proper return values. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16313 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 50473 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50473&action=edit Bug 16313 - Koha::Logger doesn't forward the Log::Log4perl::Logger return value Log::Log4perl::Logger->$method returns undef if the log level is not logged or something bad happened and true or something similar on success. This allows chaining different loggers to trigger if Log4perl failed to log. Koha::Logger is hardwired to return 1 if Log4perl is configured properly regardless of whether the Log4perl actually succeeded in printing the log message. The following is a Log4perl best practice: $Koha::Logger->debug() or syslog("LOG_DEBUG", ...); which should revert to syslog() to log if Log4perl cannot for some reason do the logging. (eg. is disabled) This patch makes the Koha::Logger work with Log4perl better in tandem and return the proper return values. See unit tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16313 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14167, 16302, 16304, 16312 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14167 [Bug 14167] Add Koha::Logger based on Log4perl 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 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16312 [Bug 16312] Koha::Logger overload configuration for command line scripts verbosity levels -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16313 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=16313 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #2 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- If you made it this far, the correct order of applying the dependant patches is as follows: Bug 16313 - Koha::Logger doesn't forward the Log::Log4perl::Logger return v~ Bug 16312 - Koha::Logger overload configuration for command line scripts ~ Bug 16306 - C4::Context->setCommandlineEnvironment() convenience function Bug 16304 - Koha::Logger, lazy load loggers so environment has time to get set Bug 16303 - Koha::Logger appenders for interface 'commandline' Bug 16302 - Koha::Logger performance tests 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=16313 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |16329 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16329 [Bug 16329] Koha::Logger->sql(). Unified interface to log SQL statements OR use DBIx::Log4perl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16313 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |BLOCKED CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Depends on a patch in Failed QA - Marking as BLOCKED until dependency can be resolved. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org