[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 David Cook changed: What|Removed |Added Text to go in the|This enhancement adds |This enhancements adds release notes|timestamped logs for each |timestamped logs for |PSGI application for|Plack-enabled Koha, which |Plack-enabled Koha. These |makes it easier for system |new log files are |administrators to review |plack-opac-error.log, |warnings and errors in |plack-intranet-error.log, |Koha. |and plack-api-error.log and | |can be found in the typical | |Koha log directory. | -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Martin Renvoize changed: What|Removed |Added Keywords|release-notes-needed| -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 David Cook changed: What|Removed |Added Text to go in the||This enhancement adds release notes||timestamped logs for each ||PSGI application for ||Plack-enabled Koha. These ||new log files are ||plack-opac-error.log, ||plack-intranet-error.log, ||and plack-api-error.log and ||can be found in the typical ||Koha log directory. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Jonathan Druart changed: What|Removed |Added Keywords|dependency |release-notes-needed -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Aleisha Amohia changed: What|Removed |Added Severity|normal |enhancement CC||alei...@catalyst.net.nz --- Comment #126 from Aleisha Amohia --- enhancement, not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Lucas Gass changed: What|Removed |Added Version(s)|20.11.00|20.11.00, 20.05.05 released in|| CC||lu...@bywatersolutions.com Status|Pushed to master|Pushed to stable --- Comment #125 from Lucas Gass --- very glad to see this one in! backported to 20.05.x for 20.05.05 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #124 from Jonathan Druart --- For information, the package does not exist in Jessie and Xenial (U16) https://gitlab.com/koha-community/koha-testing-docker/-/pipelines/195722968 -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #123 from Jonathan Druart --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Jonathan Druart changed: What|Removed |Added Status|Passed QA |Pushed to master Version(s)||20.11.00 released in|| -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #122 from David Cook --- (In reply to Martin Renvoize from comment #121) > Oh.. and this is an awesome enhancement, well-done guys! Cheers. Looking forward to having timestamps in the logs again :D -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #121 from Martin Renvoize --- Oh.. and this is an awesome enhancement, well-done guys! -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Martin Renvoize changed: What|Removed |Added CC||martin.renvoize@ptfs-europe ||.com Status|Signed Off |Passed QA --- Comment #120 from Martin Renvoize --- I will admit, this is an area I'm no expert.. but the code appears clean, works as expected and I can't find any regressions. Passing QA -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Martin Renvoize changed: What|Removed |Added Attachment #110109|0 |1 is obsolete|| --- Comment #119 from Martin Renvoize --- Created attachment 110254 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110254=edit Bug 16357: Only use Log4perl middleware if appenders defined This patch checks that the loggers used by the middleware actually have appenders defined. Without this patch, if the loggers don't have appenders defined in the log4perl file, the logs will just be lost. Signed-off-by: Arthur Suzuki Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Martin Renvoize changed: What|Removed |Added Attachment #110108|0 |1 is obsolete|| --- Comment #118 from Martin Renvoize --- Created attachment 110253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110253=edit Bug 16357: (QA follow-up) Add log4perl configs during package upgrade If plack.psgi is updated to the newer version and the log4perl.conf file is not then the warnings will not be logged anywhere. This adds the log4perl configurations that are needed for logging for pre-existing Koha installation which are upgraded. Signed-off-by: Arthur Suzuki Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Martin Renvoize changed: What|Removed |Added Attachment #110107|0 |1 is obsolete|| --- Comment #117 from Martin Renvoize --- Created attachment 110252 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110252=edit Bug 16357: (QA follow-up) Only initialize Log4perl module Koha::Logger->get was setting up some extra variables which are not used nor needed for the Plack::Middleware::Log4perl middleware to work. According to documentation at https://metacpan.org/pod/Plack::Middleware::Log4perl#SYNOPSIS only running Log::Log4perl::init, enabling Log4Perl middleware and setting up the logging category is enough. Koha::Logger->_init runs the Log::Log4perl::init and enabling and setting category is handled directly in plack.psgi. Signed-off-by: Arthur Suzuki Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Martin Renvoize changed: What|Removed |Added Attachment #109055|0 |1 is obsolete|| --- Comment #115 from Martin Renvoize --- Created attachment 110250 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110250=edit Bug 16357: Use separate Log4Perl logger for each Plack app This patch creates separate timestamped Log4Perl loggers for each Plack app, so that the Intranet, OPAC, and API are logged to separate files. To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply "Alternative" patches 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf and replace __LOG_DIR__ appropriately 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl 5) koha-plack --restart kohadev 6) Go to /cgi-bin/koha/mainpage.pl and /cgi-bin/koha/opac-main.pl 7) Open /var/log/koha/kohadev/plack-opac-error.log and /var/log/koha/kohadev/plack-intranet-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Martin Renvoize changed: What|Removed |Added Attachment #109056|0 |1 is obsolete|| --- Comment #116 from Martin Renvoize --- Created attachment 110251 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110251=edit Bug 16357: Plack error logs are not time stamped add libplack-middleware-logwarn-perl dependency to cpanfile Signed-off-by: Joonas Kylmälä Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Martin Renvoize changed: What|Removed |Added Attachment #109054|0 |1 is obsolete|| --- Comment #114 from Martin Renvoize --- Created attachment 110249 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110249=edit Bug 16357: Override __WARN__ in Plack to use Log4Perl This patch overrides __WARN__ in Plack to use Log4Perl to add timestamps to error output. The Log4Perl config uses a screen appender so the output still goes to STDERR so that it is still managed by Starman. This patch adds a Plack::Middleware::LogWarn package dependency. (The dependency is very simplistic, so we could always do out own version if we would prefer to skip the external dependency.) To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply patch 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Create some output on STDERR (it might be necessary to add a 'warn "TEST";' line to the intranet or OPAC) 5) koha-plack --restart kohadev 6) Open /var/log/koha/kohadev/plack-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at /kohadevbox/koha/opac/opac-user.pl line 59. Signed-off-by: Arthur Suzuki Signed-off-by: Joonas Kylmälä Signed-off-by: Martin Renvoize -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #113 from David Cook --- (In reply to Arthur Suzuki from comment #112) > Greetings David, > Speaking in the name of BibLibre's Support Team, we're really looking > forward to see this feature integrated into master! That's great! I'm really looking forward to it too from the support perspective! > I wouldn't mind having some reviews on my patches stack as well ;) Sure, can you send me an email with links to some bug reports? I'll put some time aside for it. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #112 from Arthur Suzuki --- Greetings David, Speaking in the name of BibLibre's Support Team, we're really looking forward to see this feature integrated into master! I wouldn't mind having some reviews on my patches stack as well ;) Arthur -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #111 from David Cook --- Cheers, Arthur. You're a legend :D. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #110 from Arthur Suzuki --- Created attachment 110109 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110109=edit Bug 16357: Only use Log4perl middleware if appenders defined This patch checks that the loggers used by the middleware actually have appenders defined. Without this patch, if the loggers don't have appenders defined in the log4perl file, the logs will just be lost. Signed-off-by: Arthur Suzuki -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Arthur Suzuki changed: What|Removed |Added Status|Needs Signoff |Signed Off Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Arthur Suzuki changed: What|Removed |Added Attachment #109067|0 |1 is obsolete|| Attachment #109068|0 |1 is obsolete|| Attachment #109215|0 |1 is obsolete|| --- Comment #108 from Arthur Suzuki --- Created attachment 110107 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110107=edit Bug 16357: (QA follow-up) Only initialize Log4perl module Koha::Logger->get was setting up some extra variables which are not used nor needed for the Plack::Middleware::Log4perl middleware to work. According to documentation at https://metacpan.org/pod/Plack::Middleware::Log4perl#SYNOPSIS only running Log::Log4perl::init, enabling Log4Perl middleware and setting up the logging category is enough. Koha::Logger->_init runs the Log::Log4perl::init and enabling and setting category is handled directly in plack.psgi. Signed-off-by: Arthur Suzuki -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #109 from Arthur Suzuki --- Created attachment 110108 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110108=edit Bug 16357: (QA follow-up) Add log4perl configs during package upgrade If plack.psgi is updated to the newer version and the log4perl.conf file is not then the warnings will not be logged anywhere. This adds the log4perl configurations that are needed for logging for pre-existing Koha installation which are upgraded. Signed-off-by: Arthur Suzuki -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 David Cook changed: What|Removed |Added Attachment #109133|0 |1 is obsolete|| --- Comment #107 from David Cook --- Created attachment 109215 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109215=edit Bug 16357: Only use Log4perl middleware if appenders defined This patch checks that the loggers used by the middleware actually have appenders defined. Without this patch, if the loggers don't have appenders defined in the log4perl file, the logs will just be lost. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 David Cook changed: What|Removed |Added Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #106 from David Cook --- (In reply to Joonas Kylmälä from comment #105) > but I don't think we should depend on that using Log4perl in the future > either. I have not found any literature what's the best practice here, but > my common sense says that things are just too easy to break if a module > author has to worry about some module using indirectly its imports. I'm inclined to agree here, although one does need to be careful. It's always possible that you explicitly import the module differently to how another module imports it, and that could create problems (in terms of exported symbols and what not). But in this case, I'm happy enough to "use Log::Log4perl" after Koha::Logger as a sort of sanity check. That said, if we did ever remove Log::Log4perl from Koha::Logger, Koha would fail very fast in koha-testing-docker. So it's not the type of problem that would sleep in Koha heh. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #105 from Joonas Kylmälä --- (In reply to Jonathan Druart from comment #104) > (In reply to Joonas Kylmälä from comment #102) > > David, in the patch I have this tiny nitpick: it misses the Log::Log4perl > > module import line, which might cause issues later if Koha::Logger in the > > future doesn't do it. Can you resubmit the patch? > > Do you think we need it? I remove Koha::Logger (import + init statements) > and there is no complain. > We don't import ReverseProxy either, I guess Plack modules are dealing with > that. We don't use ReverseProxy directly here, so yeah if plack is using that it should import it which it probably does since this wouldn't work otherwise. Here we use Log::Log4perl directly with the call to Log::Log4perl->get_logger so the module needs to be imported some way or another. With the plack.psgi there seems to be also the following code (and maybe more) that indirectly imports Log::Log4perl for us: > my $apiv1 = builder { > my $server = Mojo::Server::PSGI->new; > $server->load_app("$home/api/v1/app.pl"); > $server->to_psgi_app; > }; but I don't think we should depend on that using Log4perl in the future either. I have not found any literature what's the best practice here, but my common sense says that things are just too easy to break if a module author has to worry about some module using indirectly its imports. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #104 from Jonathan Druart --- (In reply to Joonas Kylmälä from comment #102) > David, in the patch I have this tiny nitpick: it misses the Log::Log4perl > module import line, which might cause issues later if Koha::Logger in the > future doesn't do it. Can you resubmit the patch? Do you think we need it? I remove Koha::Logger (import + init statements) and there is no complain. We don't import ReverseProxy either, I guess Plack modules are dealing with that. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #103 from David Cook --- (In reply to Joonas Kylmälä from comment #102) > David, in the patch I have this tiny nitpick: it misses the Log::Log4perl > module import line, which might cause issues later if Koha::Logger in the > future doesn't do it. Can you resubmit the patch? Yeah I had that in the back of my mind. I could do that. Not today though. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Joonas Kylmälä changed: What|Removed |Added Status|Needs Signoff |Failed QA --- Comment #102 from Joonas Kylmälä --- (In reply to David Cook from comment #101) > Created attachment 109133 [details] [review] > Bug 16357: Only use Log4perl middleware if appenders defined > > This patch checks that the loggers used by the middleware > actually have appenders defined. > > Without this patch, if the loggers don't have appenders > defined in the log4perl file, the logs will just be lost. Thanks for the patch, I think this is also a reasonable approach given the issue with get_logger() and it works as expected when I tested it. Jonathan mentioned something about showing missing Log4perl configuration in about.pl page, I see that as a follow-up bug report given the approach taken here should at least prevent the case where sysadmin has missed out on the need of these required config lines entirely. To truly prevent any issues we probably would have to hard code the log4perl.conf which is not good idea in my opinion. David, in the patch I have this tiny nitpick: it misses the Log::Log4perl module import line, which might cause issues later if Koha::Logger in the future doesn't do it. Can you resubmit the patch? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 David Cook changed: What|Removed |Added Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #101 from David Cook --- Created attachment 109133 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109133=edit Bug 16357: Only use Log4perl middleware if appenders defined This patch checks that the loggers used by the middleware actually have appenders defined. Without this patch, if the loggers don't have appenders defined in the log4perl file, the logs will just be lost. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #100 from David Cook --- Ok actually solved it with the following: 80 if ( Log::Log4perl->get_logger('plack-opac')->has_appenders ){ 81 enable 'Log4perl', category => 'plack-opac'; 82 enable 'LogWarn'; 83 } -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #99 from David Cook --- (In reply to David Cook from comment #98) > (Also getting some plugin related errors now in Koha...) Ah, that's just because Docker has consumed all my VM's disk space... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #98 from David Cook --- (In reply to David Cook from comment #97) > I suppose we could define an emergency root logger within Koha::Logger... That worked in the event that the Log4perl config wasn't set up... but it seems that appender was inherited by the plack-* loggers. (Also getting some plugin related errors now in Koha...) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #97 from David Cook --- If a category doesn't exist in the Log4perl config, Log4perl will just create a new logger that inherits from the root logger. We don't define a root logger, and the root logger by default has no appenders. If we'd just defined a root logger that output to STDERR, missing logs wouldn't be an issue. But we can't rely on someone setting up a root logger in their configuration, as we've given too many options. I suppose we could define an emergency root logger within Koha::Logger... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #96 from David Cook --- Technically you could peek at $Log::Log4perl::Logger::LOGGERS_BY_NAME, but that's cheating and hacky... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #95 from David Cook --- Actually, it's a bit of a hack... since we're telling the middleware to use the "plack-opac" category, but then we're checking for the "PLACKOPAC" appender. That relies on the log4perl config using the "PLACKOPAC" appender with the "plack-opac" category... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #94 from David Cook --- Annnd I think that I've solved it. Log::Log4perl::appender_by_name() is the key. Patch to follow... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #93 from David Cook --- (In reply to David Cook from comment #86) > Based on the documentation from https://metacpan.org/pod/Log::Log4perl, I'd > say "get_logger($category)" would probably do the trick. Wow, that definitely did not work. Instead of fetching an existing logger, it seems to create a new one. That's unexpected. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #92 from David Cook --- Updated /etc/koha/sites/kohadev/plack.psgi and now the middleware is working... And if I remove the log4perl config, the logs are lost as per Jonathan's earlier comment. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #91 from David Cook --- Ah because we now use /etc/koha/sites/kohadev/plack.psgi in koha-testing-docker... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #90 from David Cook --- (In reply to David Cook from comment #89) > To Test: > 0) apt-get install libplack-middleware-logwarn-perl > 1) Apply all patches > 3) cp debian/templates/plack.psgi /etc/koha/plack.psgi > 4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl > 5) restart_all > > Warnings show in /var/log/koha/kohadev/plack-error.log > > So... no warnings lost Note that this is without adding any conditional logic. The Plack middleware seems to notice that there are no loggers available and thus it doesn't get used. I see no issue pushing the patches, as the patches use the existing behaviour (ie they're backwards compatible) if you don't update your log4perl. If you do update your log4perl and do a restart_all... hmm it's actually not using the middleware... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #89 from David Cook --- To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply all patches 3) cp debian/templates/plack.psgi /etc/koha/plack.psgi 4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl 5) restart_all Warnings show in /var/log/koha/kohadev/plack-error.log So... no warnings lost -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #88 from David Cook --- The safest thing to do is to add the "Plack::Middleware::LogWarn" dependency, write up a wiki post about how to add timestamps and log separation, and link to the wiki post in the plack.psgi file. I don't see a clean way of fixing this for package Koha. Plus, if you take into account people installing with other methods, there's no way to guarantee that they've coordinated correctly their plack.psgi and log4perl files correctly. The system is just too configurable to be safely automatically changed. That said, we probably could create some conditional logic in plack.psgi, so that it only adds the new middleware if a Log4Perl logger with "plack" category is available. I should be doing other things but perhaps I'll look at that now... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #87 from David Cook --- I notice that /usr/sbin/koha-plack refers to a possible "/etc/koha/sites/${instancename}/plack.psgi" That adds yet another layer of complexity. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #86 from David Cook --- (In reply to Joonas Kylmälä from comment #85) > To fail more verbosely during plack startup there would need to be a way in > Log4perl to check whether a logger category (e.g. "plack-opac") exists in > the log4perl.conf file. I couldn't find any such function in the > Log::Log4Perl module. We could also implement our own parser for the > log4perl.conf file but that doesn't sound ideal. Help needed. Based on the documentation from https://metacpan.org/pod/Log::Log4perl, I'd say "get_logger($category)" would probably do the trick. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #85 from Joonas Kylmälä --- To fail more verbosely during plack startup there would need to be a way in Log4perl to check whether a logger category (e.g. "plack-opac") exists in the log4perl.conf file. I couldn't find any such function in the Log::Log4Perl module. We could also implement our own parser for the log4perl.conf file but that doesn't sound ideal. Help needed. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #84 from Joonas Kylmälä --- Jonathan, I redid the postinst patch given it was not fully done, and switched to calling _init. For further details see the commit messages. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Joonas Kylmälä changed: What|Removed |Added Attachment #109060|0 |1 is obsolete|| --- Comment #82 from Joonas Kylmälä --- Created attachment 109067 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109067=edit Bug 16357: (QA follow-up) Only initialize Log4perl module Koha::Logger->get was setting up some extra variables which are not used nor needed for the Plack::Middleware::Log4perl middleware to work. According to documentation at https://metacpan.org/pod/Plack::Middleware::Log4perl#SYNOPSIS only running Log::Log4perl::init, enabling Log4Perl middleware and setting up the logging category is enough. Koha::Logger->_init runs the Log::Log4perl::init and enabling and setting category is handled directly in plack.psgi. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #83 from Joonas Kylmälä --- Created attachment 109068 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109068=edit Bug 16357: (QA follow-up) Add log4perl configs during package upgrade If plack.psgi is updated to the newer version and the log4perl.conf file is not then the warnings will not be logged anywhere. This adds the log4perl configurations that are needed for logging for pre-existing Koha installation which are upgraded. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Joonas Kylmälä changed: What|Removed |Added Status|Passed QA |In Discussion --- Comment #81 from Joonas Kylmälä --- (In reply to Jonathan Druart from comment #75) > > And, basically, I don't understand how this work. Can you explain a bit > > more? I am confused by the Koha::Logger->get_logger call from .psgi > > Should not we actually replace Koha::Logger->get_logger by > Koha::Logger->_init? Reading Koha/Logger.pm and https://metacpan.org/pod/Plack::Middleware::Log4perl I got some background to this. So basically it looks like if Koha::Logger->get is not used in Koha code (so all unexpected errors/warnings basically) then the context variable that is set in the plack.psgi is used as a fallback. I think you are right that we should use Koha::Logger->_init. As per the documentation I linked for the Log4Perl middleware only Log::Log4perl::init() which Koha::Logger->_init does AND setting category variable is needed for it to function. Running Koha::Logger->get just sets some extra variables which we are not even accessing. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #80 from Joonas Kylmälä --- (In reply to Jonathan Druart from comment #78) > (In reply to David Cook from comment #55) > > (In reply to Tomás Cohen Arazi from comment #37) > > > Question: shouldn't we take the oportunity to actually split the logs for > > > each interace? > > > > Agreed and achieved. Patch to follow. > > This should have been part of a separated bug report in my opinion. > > Focus should have been put on adding the timestamp, nothing else. Given the patches are already here I think we could just go ahead with this together with your follow-up, and keep this in mind for future work. (In reply to Joonas Kylmälä from comment #77) > (In reply to Jonathan Druart from comment #76) > > yes but plack.psgi will be modified, and then the logger won't be init > > correctly. > > It works with the modification, I tested. The reason why it worked I think was that the debian package didn't update plack.psgi during upgrade. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #79 from Jonathan Druart --- (In reply to Joonas Kylmälä from comment #77) > (In reply to Jonathan Druart from comment #76) > > > Btw, I was thinking we don't need to modify even the log4perl.conf in > > > pre-existing installations given without the postinst script modification > > > you attached it keeps working the same way as before and then the sysadmin > > > can add these separate log files at the time of their preference > > > > yes but plack.psgi will be modified, and then the logger won't be init > > correctly. > > It works with the modification, I tested. It "works", but the logs are lost -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #78 from Jonathan Druart --- (In reply to David Cook from comment #55) > (In reply to Tomás Cohen Arazi from comment #37) > > Question: shouldn't we take the oportunity to actually split the logs for > > each interace? > > Agreed and achieved. Patch to follow. This should have been part of a separated bug report in my opinion. Focus should have been put on adding the timestamp, nothing else. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #77 from Joonas Kylmälä --- (In reply to Jonathan Druart from comment #76) > > Btw, I was thinking we don't need to modify even the log4perl.conf in > > pre-existing installations given without the postinst script modification > > you attached it keeps working the same way as before and then the sysadmin > > can add these separate log files at the time of their preference > > yes but plack.psgi will be modified, and then the logger won't be init > correctly. It works with the modification, I tested. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #76 from Jonathan Druart --- (In reply to Joonas Kylmälä from comment #74) > (In reply to Jonathan Druart from comment #72) > > In my understanding, following what was done before, we should add the new > > lines during postinst. > > But here we also want to remove the existing "log4perl.logger.plack", right? > > log4perl.logger.plack is added by the first patch in this series, it has not > existed before so I don't think it needs to be added to postinst script > since these patches will be pushed together. Indeed! > Btw, I was thinking we don't need to modify even the log4perl.conf in > pre-existing installations given without the postinst script modification > you attached it keeps working the same way as before and then the sysadmin > can add these separate log files at the time of their preference yes but plack.psgi will be modified, and then the logger won't be init correctly. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #75 from Jonathan Druart --- > And, basically, I don't understand how this work. Can you explain a bit > more? I am confused by the Koha::Logger->get_logger call from .psgi Should not we actually replace Koha::Logger->get_logger by Koha::Logger->_init? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Przemek Sztuczyński changed: What|Removed |Added CC|p.sztuczyn...@gmail.com | -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #74 from Joonas Kylmälä --- (In reply to Jonathan Druart from comment #72) > In my understanding, following what was done before, we should add the new > lines during postinst. > But here we also want to remove the existing "log4perl.logger.plack", right? log4perl.logger.plack is added by the first patch in this series, it has not existed before so I don't think it needs to be added to postinst script since these patches will be pushed together. Btw, I was thinking we don't need to modify even the log4perl.conf in pre-existing installations given without the postinst script modification you attached it keeps working the same way as before and then the sysadmin can add these separate log files at the time of their preference -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #73 from Jonathan Druart --- (In reply to Jonathan Druart from comment #72) > In my understanding, following what was done before, we should add the new > lines during postinst. > But here we also want to remove the existing "log4perl.logger.plack", right? Or, maybe we should keep log4perl.logger.plack (ie. stderr) as fallback if the logger does not get initiated properly? Would that be possible? And, basically, I don't understand how this work. Can you explain a bit more? I am confused by the Koha::Logger->get_logger call from .psgi -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #72 from Jonathan Druart --- In my understanding, following what was done before, we should add the new lines during postinst. But here we also want to remove the existing "log4perl.logger.plack", right? -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #71 from Jonathan Druart --- Created attachment 109060 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109060=edit Bug 16357: Add new lines during for debian postinst -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #70 from Joonas Kylmälä --- All looks good, also with debian package side of things. Ready for RM to merge. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #68 from Joonas Kylmälä --- Created attachment 109055 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109055=edit Bug 16357: Use separate Log4Perl logger for each Plack app This patch creates separate timestamped Log4Perl loggers for each Plack app, so that the Intranet, OPAC, and API are logged to separate files. To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply "Alternative" patches 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf and replace __LOG_DIR__ appropriately 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl 5) koha-plack --restart kohadev 6) Go to /cgi-bin/koha/mainpage.pl and /cgi-bin/koha/opac-main.pl 7) Open /var/log/koha/kohadev/plack-opac-error.log and /var/log/koha/kohadev/plack-intranet-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #69 from Joonas Kylmälä --- Created attachment 109056 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109056=edit Bug 16357: Plack error logs are not time stamped add libplack-middleware-logwarn-perl dependency to cpanfile Signed-off-by: Joonas Kylmälä -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Joonas Kylmälä changed: What|Removed |Added Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Joonas Kylmälä changed: What|Removed |Added Attachment #77529|0 |1 is obsolete|| Attachment #77530|0 |1 is obsolete|| Attachment #77531|0 |1 is obsolete|| Attachment #77532|0 |1 is obsolete|| Attachment #77533|0 |1 is obsolete|| Attachment #106319|0 |1 is obsolete|| Attachment #106320|0 |1 is obsolete|| Attachment #109053|0 |1 is obsolete|| --- Comment #67 from Joonas Kylmälä --- Created attachment 109054 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109054=edit Bug 16357: Override __WARN__ in Plack to use Log4Perl This patch overrides __WARN__ in Plack to use Log4Perl to add timestamps to error output. The Log4Perl config uses a screen appender so the output still goes to STDERR so that it is still managed by Starman. This patch adds a Plack::Middleware::LogWarn package dependency. (The dependency is very simplistic, so we could always do out own version if we would prefer to skip the external dependency.) To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply patch 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Create some output on STDERR (it might be necessary to add a 'warn "TEST";' line to the intranet or OPAC) 5) koha-plack --restart kohadev 6) Open /var/log/koha/kohadev/plack-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at /kohadevbox/koha/opac/opac-user.pl line 59. Signed-off-by: Arthur Suzuki Signed-off-by: Joonas Kylmälä -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #66 from Mason James --- Created attachment 109053 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109053=edit Bug 16357: Plack error logs are not time stamped add libplack-middleware-logwarn-perl dependency to cpanfile -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #65 from Joonas Kylmälä --- (In reply to David Cook from comment #64) > Which patch set did you try? Your comment isn't clear. I tried to apply the patches from Jonathan, and then I thought incorrectly your alternative patches were for just the last one or two patches from Jonathan given the patches from Joubu had that sha1 informations is lacking error. I now looked at this again and I understand that your patches were meant to be used standalone. I will let you know my updated comments on the approach now that have this working. > Re: debian/control, I hadn't heard definitively from the QA/Release team > about that. I notice you were added to the QA team for 20.05. Can you > confirm that all dependencies should be added via the cpanfile? I'm happy to > resubmit moving the debian/control change to the cpanfile. This seems to be a recent thing and I only I heard about this in comment https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25723#c79 I couldn't find any wiki documentation for this, so all I know is that and git log debian/control, and the comment on top of debian/control file. We could ping maybe Mason or Martin on IRC to clarify this. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #64 from David Cook --- (In reply to Joonas Kylmälä from comment #63) > even if I apply the patches on top of the Koha version from the day the > patches were submitted I get: > > Applying: Bug 16357: (follow-up) Use Koha::Logger and add fatal errors > error: sha1 information is lacking or useless (debian/templates/plack.psgi). > error: could not build fake ancestor > Patch failed at 0001 Bug 16357: (follow-up) Use Koha::Logger and add fatal > errors Which patch set did you try? Your comment isn't clear. > Also the dependency is unclear in both alternative patches for > libplack-middleware-logwarn-perl, does the latter alternative need it also? > Either way, the dependency should be probably added to cpanfile since > debian/control is autogenerated and should not be tweaked manually. I'm fine > with the latter alternative approach btw, so please just resubmit that since > I was under the impression David preferred that too. Yes, both patches marked [Alternative] are part of the same patch set. I think the dependency is clear. They both must be applied as per the test plan below: To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply "Alternative" patches 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf and replace __LOG_DIR__ appropriately 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl 5) koha-plack --restart kohadev 6) Go to /cgi-bin/koha/mainpage.pl and /cgi-bin/koha/opac-main.pl 7) Open /var/log/koha/kohadev/plack-opac-error.log and /var/log/koha/kohadev/plack-intranet-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Joonas Kylmälä changed: What|Removed |Added Status|Signed Off |Failed QA --- Comment #63 from Joonas Kylmälä --- Hi, even if I apply the patches on top of the Koha version from the day the patches were submitted I get: Applying: Bug 16357: (follow-up) Use Koha::Logger and add fatal errors error: sha1 information is lacking or useless (debian/templates/plack.psgi). error: could not build fake ancestor Patch failed at 0001 Bug 16357: (follow-up) Use Koha::Logger and add fatal errors Also the dependency is unclear in both alternative patches for libplack-middleware-logwarn-perl, does the latter alternative need it also? Either way, the dependency should be probably added to cpanfile since debian/control is autogenerated and should not be tweaked manually. I'm fine with the latter alternative approach btw, so please just resubmit that since I was under the impression David preferred that too. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #62 from David Cook --- (In reply to Jonathan Druart from comment #61) > In my understanding they are an alternative approach. QA will pick one or > the other. Yep, that was my intention when I wrote those [Alternative] patches. I think they're a better alternative, but I'm biased as the author of them ;). -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #61 from Jonathan Druart --- In my understanding they are an alternative approach. QA will pick one or the other. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Joonas Kylmälä changed: What|Removed |Added CC||joonas.kylm...@helsinki.fi --- Comment #60 from Joonas Kylmälä --- Hi, I was looking into QA'ing this but I don't know for sure if those two last patches with [Alternative] in the title are supposed to be included? Could someone who was working on this clarify the situation please? If the two patches should be included it would be nice to push them again without the [Alternative] annotation and use (follow-up) instead. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Katrin Fischer changed: What|Removed |Added Keywords||dependency -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Arthur Suzuki changed: What|Removed |Added Status|Needs Signoff |Signed Off CC||arthur.suz...@biblibre.com --- Comment #59 from Arthur Suzuki --- Nice job! Works as expected :) -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Arthur Suzuki changed: What|Removed |Added Attachment #106313|0 |1 is obsolete|| --- Comment #58 from Arthur Suzuki --- Created attachment 106320 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106320=edit Bug 16357: [Alternative] Use separate Log4Perl logger for each Plack app This patch creates separate timestamped Log4Perl loggers for each Plack app, so that the Intranet, OPAC, and API are logged to separate files. To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply "Alternative" patches 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf and replace __LOG_DIR__ appropriately 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl 5) koha-plack --restart kohadev 6) Go to /cgi-bin/koha/mainpage.pl and /cgi-bin/koha/opac-main.pl 7) Open /var/log/koha/kohadev/plack-opac-error.log and /var/log/koha/kohadev/plack-intranet-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Arthur Suzuki changed: What|Removed |Added Attachment #106141|0 |1 is obsolete|| --- Comment #57 from Arthur Suzuki --- Created attachment 106319 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106319=edit Bug 16357: [Alternative] Override __WARN__ in Plack to use Log4Perl This patch overrides __WARN__ in Plack to use Log4Perl to add timestamps to error output. The Log4Perl config uses a screen appender so the output still goes to STDERR so that it is still managed by Starman. This patch adds a Plack::Middleware::LogWarn package dependency. (The dependency is very simplistic, so we could always do out own version if we would prefer to skip the external dependency.) To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply patch 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Create some output on STDERR (it might be necessary to add a 'warn "TEST";' line to the intranet or OPAC) 5) koha-plack --restart kohadev 6) Open /var/log/koha/kohadev/plack-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at /kohadevbox/koha/opac/opac-user.pl line 59. Signed-off-by: Arthur Suzuki -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #56 from David Cook --- Created attachment 106313 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106313=edit Bug 16357: [Alternative] Use separate Log4Perl logger for each Plack app This patch creates separate timestamped Log4Perl loggers for each Plack app, so that the Intranet, OPAC, and API are logged to separate files. To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply "Alternative" patches 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf and replace __LOG_DIR__ appropriately 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Temporarily add 'warn "TEST"' to opac-main.pl and mainpage.pl 5) koha-plack --restart kohadev 6) Go to /cgi-bin/koha/mainpage.pl and /cgi-bin/koha/opac-main.pl 7) Open /var/log/koha/kohadev/plack-opac-error.log and /var/log/koha/kohadev/plack-intranet-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #55 from David Cook --- (In reply to Tomás Cohen Arazi from comment #37) > Question: shouldn't we take the oportunity to actually split the logs for > each interace? Agreed and achieved. Patch to follow. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #54 from David Cook --- Forgot that I'd updated my log4perl.conf and plack.psgi in koha-testing-docker and now I have this fix when troubleshooting other issues. Awesome. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #53 from David Cook --- (In reply to Tomás Cohen Arazi from comment #37) > I didn't manage to make this work. Feedback and review from the authors is > needed. > Question: shouldn't we take the oportunity to actually split the logs for > each interace? Oh yeah... that would've been a good idea. I think that we can add specific middleware to the opac and intranet apps using Plack::Builder (https://metacpan.org/pod/Plack::Builder). I am starving for lunch, but this could be an interesting one to do... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 David Cook changed: What|Removed |Added Assignee|m...@kohaaloha.com |dc...@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 David Cook changed: What|Removed |Added Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #52 from David Cook --- Created attachment 106141 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106141=edit Bug 16357: [Alternative] Override __WARN__ in Plack to use Log4Perl This patch overrides __WARN__ in Plack to use Log4Perl to add timestamps to error output. The Log4Perl config uses a screen appender so the output still goes to STDERR so that it is still managed by Starman. This patch adds a Plack::Middleware::LogWarn package dependency. (The dependency is very simplistic, so we could always do out own version if we would prefer to skip the external dependency.) To Test: 0) apt-get install libplack-middleware-logwarn-perl 1) Apply patch 2) Copy PLACK block from etc/log4perl.conf to /etc/koha/sites/kohadev/log4perl.conf 3) Copy debian/templates/plack.psgi to /etc/koha/sites/kohadev/plack.psgi 4) Create some output on STDERR (it might be necessary to add a 'warn "TEST";' line to the intranet or OPAC) 5) koha-plack --restart kohadev 6) Open /var/log/koha/kohadev/plack-error.log 7) Observe a log line like the following: [2020/06/22 03:51:23] [WARN] TEST at /kohadevbox/koha/opac/opac-user.pl line 59. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #51 from David Cook --- Ok I have a usable alternative. Patch incoming. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #50 from David Cook --- Bug 16357 - Plack error logs are not time stamped 77529 - Bug 16357 - Plack error logs are not time stamped 77530 - Bug 16357 - Plack error logs are not time stamped (follow up) fix typo in comment 77531 - Bug 16357 - Plack error logs are not time stamped (follow up) enable UTF8 77532 - Bug 16357: (follow-up) Use Koha::Logger and add fatal errors 77533 - Bug 16357 - Use Koha::Logger via Plack::Middleware::Log4perl Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 16357 - Plack error logs are not time stamped Applying: Bug 16357 - Plack error logs are not time stamped (follow up) fix typo in comment Applying: Bug 16357 - Plack error logs are not time stamped (follow up) enable UTF8 Applying: Bug 16357: (follow-up) Use Koha::Logger and add fatal errors error: sha1 information is lacking or useless (debian/templates/plack.psgi). error: could not build fake ancestor Patch failed at 0001 Bug 16357: (follow-up) Use Koha::Logger and add fatal errors The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-16357-follow-up-Use-KohaLogger-and-add-fatal-e-E_xhfg.patch -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #49 from David Cook --- It really doesn't look like we have many great options after reading through the following: https://metacpan.org/release/Plack/source/lib/Plack/App/CGIBin.pm https://metacpan.org/source/Plack::App::WrapCGI At a glance, I think these patches should be OKish, but I'll take another look now... -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #48 from David Cook --- Now that I'm using Plack more, this is seriously annoying me. I'll look a bit at a fix. I have some ideas. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #47 from Victor Grousset/tuxayo --- == Workaround == At a sysadmin level, something is doable using the "ts" command. https://www.reddit.com/r/linux/comments/fqiu6b/til_about_vipe/ > ts: timestamp standard input dirty proof of concept: have a daemon running `tail -f plack-error.log | ts > plack-error-timestamped.log A true sysadmin could find a more clean solution. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #46 from David Cook --- I have some thoughts on this one. Firstly, why are we using Log::Log4perl::Appender::File at all? It doesn't make sense, unless you're going to be logging to custom files independent of your webserver. Since we're already leveraging the log file directives of Apache or Starman and expecting to use their log files, let's just use Log::Log4perl::Appender::Screen and set log4perl.appender.Screen.stderr = 1 to log to STDERR. Easy as. Then the log files would be handled automagically by the web servers. If we, for some reason, must use Log::Log4perl::Appender::File, then let's use application-specific webserver-independent log files. So that's probably what we *should* do. Let's look at what we're currently doing... -- Looking at /etc/logrotate.d/koha-common, it looks like "sharedscripts" will imply "create" which in the absence of configuration will use the existing file attributes. That explains why the rotated log files are the same as the ones that came before them. (The only issue there would be if you switched from Apache to Plack and didn't chmod the files in the process I suppose.) I took a look at ./etc/log4perl.conf and ./debian/templates/log4perl-site.conf.in, and it looks like the defaults are the Apache logs. I suppose that is technically OK if Apache is running Koha as a set of CGI scripts, but really doesn't make sense if you're running Koha as a PSGI app. -- In summary, I think the issue is with our Log4Perl default configuration, and not a permissions issue per se. I'm looking at a Koha running Plack at the moment, and it looks like the Log4Perl appenders aren't even used. I'm guessing that they silently fail since the Starman user can't write to the root owned Apache files. -- Alas, I don't have time to work on this, but that's my 2 cents. I'd say the easiest solution is to change to Log::Log4perl::Appender::Screen and set log4perl.appender.Screen.stderr = 1, and then not worry about managing the log files outside the web servers. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #45 from Liz Rea --- The "bad" perms, are the way that they are always created - if you delete the logs and re initialize them they come back that way. :D -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #44 from Liz Rea --- intranet error and opac error tho, those ones are created by apache, not plack. And those are the ones with the bad perms. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #43 from Tomás Cohen Arazi --- Plack logs should be generated by Plack, no Apache at all. And my guess at some point was that starman (or the koha-plack script runnning as root) was to blame for the permissions. -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #42 from Liz Rea --- i forgot to put in the perms that work with this patch: vagrant@kohadevbox:kohadev$ ls -lha total 688K drwxr-xr-x 2 kohadev-koha kohadev-koha 4.0K Aug 30 14:50 . drwxr-xr-x 3 root root 4.0K Aug 30 14:47 .. -rw-r--r-- 1 kohadev-koha kohadev-koha 25K Aug 30 18:36 indexer-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha0 Aug 30 14:47 indexer-output.log -rw-r--r-- 1 kohadev-koha kohadev-koha0 Aug 30 14:47 intranet-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha 105K Aug 30 14:49 opac-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha 524K Aug 30 18:36 plack-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha 6.8K Aug 30 18:36 plack.log -rw-r--r-- 1 kohadev-koha kohadev-koha 773 Aug 30 18:36 zebra-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha 399 Aug 30 18:36 zebra-output.log -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 --- Comment #41 from Liz Rea --- Ok, I've made this work again, and I followed my previous notes to get there with the addition of one detail by default, the log perms look like this: vagrant@kohadevbox:kohadev$ ls -lah total 688K drwxr-xr-x 2 kohadev-koha kohadev-koha 4.0K Aug 30 14:50 . drwxr-xr-x 3 root root 4.0K Aug 30 14:47 .. -rw-r--r-- 1 kohadev-koha kohadev-koha 25K Aug 30 18:36 indexer-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha0 Aug 30 14:47 indexer-output.log -rw-r--r-- 1 root root0 Aug 30 14:47 intranet-error.log -rw-r--r-- 1 root root 105K Aug 30 14:49 opac-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha 524K Aug 30 18:36 plack-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha 6.8K Aug 30 18:36 plack.log -rw-r--r-- 1 kohadev-koha kohadev-koha 773 Aug 30 18:36 zebra-error.log -rw-r--r-- 1 kohadev-koha kohadev-koha 399 Aug 30 18:36 zebra-output.log If you apply this patch, and restart plack and try for an error: "Log4perl: Seems like no initialization happened. Forgot to call init()?" Ok that's not great. So look at Koha::Logger - in 119 sub _init { 120 my $rv; 121 if ( exists $ENV{"LOG4PERL_CONF"} and $ENV{'LOG4PERL_CONF'} and -s $ENV{"LOG4PERL_CONF"} ) { 122 123 # Check for web server level configuration first 124 # In this case we ASSUME that you correctly arranged logfile 125 # permissions. If not, log4perl will crash on you. 126 # We will not parse apache files here. 127 Log::Log4perl->init_once( $ENV{"LOG4PERL_CONF"} ); 128 } 129 elsif ( C4::Context->config("log4perl_conf") ) { 130 131 # Now look in the koha conf file. We only check the permissions of 132 # the default logfiles. For the rest, we again ASSUME that 133 # you arranged file permissions. 134 my $conf = C4::Context->config("log4perl_conf"); 135 if ( $rv = _check_conf($conf) ) { 136 Log::Log4perl->init_once($conf); 137 return $rv; 138 } 139 else { 140 return 0; 141 } 142 } 143 else { 144 # This means that you do not use log4perl currently. 145 # We will not be forcing it. 146 return 0; 147 } 148 warn "Log4Perl did not crash"; 149 150 return 1;# if we make it here, log4perl did not crash :) 151 } I didn't have any environment variables set in my devbox, so we're looking at the path from koha-conf.xml. So we assume "you arranged the file permissions" and something about this doesn't sit right with me, and probably explains what is happening here. Anyway, with this patch installed the default way I've done for testing, apparently _check_conf fails - probably bc koha-kohadev can't write the apache initialized logs. With the permissions set for owner koha-kohadev:koha-kohadev, the patch works. When the log files are initialized, there are some that are set by Apache (opac-access/error, intranet-access/error) and plack, which is initialized by Koha. The plack one is owned by the instance, the apache ones are owned by root. Logrotate will set these permissions back at rotate time. Does somebody out there know more than me about logrotate and apache, to help get these permissions doing the right thing? This patch is really necessary (splitting is nice and stuff, but timestamps alone would be super ace). -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
[Koha-bugs] [Bug 16357] Plack error logs are not time stamped
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16357 Danielle Elder changed: What|Removed |Added CC||danielle@bywatersolutions.c ||om --- Comment #40 from Danielle Elder --- 1+ split logs please -- You are receiving this mail because: You are watching all bug changes. ___ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/