Bug 31469 - log4perl.conf: Plack logfiles need %n in conversionpattern
Summary: log4perl.conf: Plack logfiles need %n in conversionpattern
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-26 09:42 UTC by Marcel de Rooy
Modified: 2023-12-28 20:44 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.08, 21.11.15


Attachments
Bug 31469: log4perl.conf: Add %n to conversionpattern for Plack (7.37 KB, patch)
2022-09-29 08:25 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 31469: log4perl.conf: Add %n to conversionpattern for Plack (7.39 KB, patch)
2022-10-07 10:00 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2022-08-26 09:42:20 UTC

    
Comment 1 Marcel de Rooy 2022-09-29 08:25:24 UTC
Created attachment 141079 [details] [review]
Bug 31469: log4perl.conf: Add %n to conversionpattern for Plack

The PLACKOPAC, PLACKAPI and PLACKINTRANET appenders still need %n
(i.e. a newline). Note that this patch does not add %l since it
is a bit confusing because it adds a lot of Plack internal noise like:
    [2022/09/29 08:51:34] [WARN] Test mainpage CGI::Compile::ROOT::usr_share_koha_mainpage_2epl::__ANON__ /usr/share/koha/mainpage.pl (49)

The patch is a result of:
    git grep -l "log4perl.appender.PLACK" | xargs sed -i -e"/ConversionPattern/ s/%m$/%m%n/"

Test plan:
First run: sed -i -e"/ConversionPattern/ s/%m$/%m%n/" /etc/koha/sites/[YOUR_CLONE]/log4perl.conf
Edit that file, change PLACKOPAC to debug level like:
    log4perl.logger.plack-opac = DEBUG, PLACKOPAC
Restart.
Hit an OPAC page twice.
Check plack-opac logfile and verify that it contains a newline between last two messages like:
    [2022/09/29 08:04:30] [DEBUG] kohaversion : 22.0600054
    [2022/09/29 08:04:42] [DEBUG] kohaversion : 22.0600054

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2022-09-29 08:26:14 UTC
Adding a newline. Trivial self SO.
Comment 3 Marcel de Rooy 2022-09-29 08:26:58 UTC
Anyone from QA, or RM ?
Comment 4 Martin Renvoize 2022-10-07 10:00:43 UTC
Created attachment 141483 [details] [review]
Bug 31469: log4perl.conf: Add %n to conversionpattern for Plack

The PLACKOPAC, PLACKAPI and PLACKINTRANET appenders still need %n
(i.e. a newline). Note that this patch does not add %l since it
is a bit confusing because it adds a lot of Plack internal noise like:
    [2022/09/29 08:51:34] [WARN] Test mainpage CGI::Compile::ROOT::usr_share_koha_mainpage_2epl::__ANON__ /usr/share/koha/mainpage.pl (49)

The patch is a result of:
    git grep -l "log4perl.appender.PLACK" | xargs sed -i -e"/ConversionPattern/ s/%m$/%m%n/"

Test plan:
First run: sed -i -e"/ConversionPattern/ s/%m$/%m%n/" /etc/koha/sites/[YOUR_CLONE]/log4perl.conf
Edit that file, change PLACKOPAC to debug level like:
    log4perl.logger.plack-opac = DEBUG, PLACKOPAC
Restart.
Hit an OPAC page twice.
Check plack-opac logfile and verify that it contains a newline between last two messages like:
    [2022/09/29 08:04:30] [DEBUG] kohaversion : 22.0600054
    [2022/09/29 08:04:42] [DEBUG] kohaversion : 22.0600054

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2022-10-07 10:01:00 UTC
Works for me, Passing QA
Comment 6 Tomás Cohen Arazi 2022-10-12 18:00:02 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 7 Lucas Gass 2022-12-05 18:57:07 UTC
Backported to 22.05.x for 22.05.08
Comment 8 Arthur Suzuki 2022-12-14 15:25:28 UTC
applied to 21.11 for 21.11.15
Comment 9 wainuiwitikapark 2023-03-15 00:53:32 UTC
Not backported to 21.05.x