Summary: | INTRANET and OPAC loggers should print to STDERR instead of to file | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Architecture, internals, and plumbing | Assignee: | Bugs List <koha-bugs> |
Status: | CLOSED INVALID | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | nugged |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25284 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 28477: Change INTRANET and OPAC logs to use STDERR rather than file
Bug 28477: Add unit test to prove logging to STDERR works |
Description
David Cook
2021-05-28 00:25:25 UTC
The logger is a bit of a pain to test though, so not sure how much energy I actually have to devote to testing this change... Created attachment 121466 [details] [review] Bug 28477: Change INTRANET and OPAC logs to use STDERR rather than file This patch changes the default Log4Perl config to use STDERR instead of the Apache log files for the INTRANET and OPAC loggers. Created attachment 121467 [details] [review] Bug 28477: Add unit test to prove logging to STDERR works This patch shows that using the Screen/Stderr=1 Log4perl configuration with Koha::Logger will output to STDERR. Note that the first test in t/Logger.t was already broken, and looks like a pain to test due to Log::Log4perl being a singleton... If folk have tests for the actual intranet and opac scripts, that would be great. I can't be bothered trying to work those out right now. -- Although the more I think about it... While this should work fine with Apache, it might not work as one might expect with Plack in regards to Bug 16357. Bug 16357 overwrites SIGWARN, but Log::Log4perl isn't using SIGWARN. It's printing to STDERR. So the errors would wind up in plack-error.log (rather than plack-intranet-error.log or plack-opac-error.log). That's not great because the logs aren't separated... -- Maybe we shouldn't have called the error files plack-opac-error.log and plack-intranet-error.log and instead just called them koha-opac-error.log and koha-intranet-error.log and set both appenders to logging to the same file... Sidenote: we also have pack-error.log without timestamps, which makes backtrace and debugging of important dies very hard on productions. Do we have anything on that? (In reply to Andrew Nugged from comment #6) > Sidenote: we also have pack-error.log without timestamps, which makes > backtrace and debugging of important dies very hard on productions. Do we > have anything on that? Bug 16357 should resolve that issue. Looks like it's available from 20.11+ and backported to 20.05.05. Koha has changed its Plack logging since this was reported |