From 73d3abd65db07ab74d0e61641f84682e425c33e1 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 29 Sep 2022 07:51:33 +0000 Subject: [PATCH] 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 Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit ef81785d76115d1591075ed1d04a1dfe4430c5eb) Signed-off-by: Lucas Gass --- debian/koha-common.postinst | 6 +++--- debian/koha-core.postinst | 6 +++--- debian/templates/log4perl-site.conf.in | 6 +++--- etc/log4perl.conf | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/debian/koha-common.postinst b/debian/koha-common.postinst index f8914fb25d..2540ea654f 100644 --- a/debian/koha-common.postinst +++ b/debian/koha-common.postinst @@ -198,7 +198,7 @@ log4perl.appender.PLACKOPAC=Log::Log4perl::Appender::File log4perl.appender.PLACKOPAC.filename=/var/log/koha/$site/plack-opac-error.log log4perl.appender.PLACKOPAC.mode=append log4perl.appender.PLACKOPAC.layout=PatternLayout -log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKOPAC.utf8=1 EOF @@ -214,7 +214,7 @@ log4perl.appender.PLACKAPI=Log::Log4perl::Appender::File log4perl.appender.PLACKAPI.filename=/var/log/koha/$site/plack-api-error.log log4perl.appender.PLACKAPI.mode=append log4perl.appender.PLACKAPI.layout=PatternLayout -log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKAPI.utf8=1 EOF @@ -230,7 +230,7 @@ log4perl.appender.PLACKINTRANET=Log::Log4perl::Appender::File log4perl.appender.PLACKINTRANET.filename=/var/log/koha/$site/plack-intranet-error.log log4perl.appender.PLACKINTRANET.mode=append log4perl.appender.PLACKINTRANET.layout=PatternLayout -log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKINTRANET.utf8=1 EOF diff --git a/debian/koha-core.postinst b/debian/koha-core.postinst index 661b7bd016..8162c00870 100644 --- a/debian/koha-core.postinst +++ b/debian/koha-core.postinst @@ -198,7 +198,7 @@ log4perl.appender.PLACKOPAC=Log::Log4perl::Appender::File log4perl.appender.PLACKOPAC.filename=/var/log/koha/$site/plack-opac-error.log log4perl.appender.PLACKOPAC.mode=append log4perl.appender.PLACKOPAC.layout=PatternLayout -log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKOPAC.utf8=1 EOF @@ -214,7 +214,7 @@ log4perl.appender.PLACKAPI=Log::Log4perl::Appender::File log4perl.appender.PLACKAPI.filename=/var/log/koha/$site/plack-api-error.log log4perl.appender.PLACKAPI.mode=append log4perl.appender.PLACKAPI.layout=PatternLayout -log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKAPI.utf8=1 EOF @@ -230,7 +230,7 @@ log4perl.appender.PLACKINTRANET=Log::Log4perl::Appender::File log4perl.appender.PLACKINTRANET.filename=/var/log/koha/$site/plack-intranet-error.log log4perl.appender.PLACKINTRANET.mode=append log4perl.appender.PLACKINTRANET.layout=PatternLayout -log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKINTRANET.utf8=1 EOF diff --git a/debian/templates/log4perl-site.conf.in b/debian/templates/log4perl-site.conf.in index a95ab73163..9c0339a99a 100644 --- a/debian/templates/log4perl-site.conf.in +++ b/debian/templates/log4perl-site.conf.in @@ -44,7 +44,7 @@ log4perl.appender.PLACKOPAC=Log::Log4perl::Appender::File log4perl.appender.PLACKOPAC.filename=__LOG_DIR__/plack-opac-error.log log4perl.appender.PLACKOPAC.mode=append log4perl.appender.PLACKOPAC.layout=PatternLayout -log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKOPAC.utf8=1 log4perl.logger.plack-api = WARN, PLACKAPI @@ -52,7 +52,7 @@ log4perl.appender.PLACKAPI=Log::Log4perl::Appender::File log4perl.appender.PLACKAPI.filename=__LOG_DIR__/plack-api-error.log log4perl.appender.PLACKAPI.mode=append log4perl.appender.PLACKAPI.layout=PatternLayout -log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKAPI.utf8=1 log4perl.logger.plack-intranet = WARN, PLACKINTRANET @@ -60,5 +60,5 @@ log4perl.appender.PLACKINTRANET=Log::Log4perl::Appender::File log4perl.appender.PLACKINTRANET.filename=__LOG_DIR__/plack-intranet-error.log log4perl.appender.PLACKINTRANET.mode=append log4perl.appender.PLACKINTRANET.layout=PatternLayout -log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKINTRANET.utf8=1 diff --git a/etc/log4perl.conf b/etc/log4perl.conf index 6736c3d1ba..a07d139d96 100644 --- a/etc/log4perl.conf +++ b/etc/log4perl.conf @@ -43,7 +43,7 @@ log4perl.appender.PLACKOPAC=Log::Log4perl::Appender::File log4perl.appender.PLACKOPAC.filename=__LOG_DIR__/plack-opac-error.log log4perl.appender.PLACKOPAC.mode=append log4perl.appender.PLACKOPAC.layout=PatternLayout -log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKOPAC.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKOPAC.utf8=1 log4perl.logger.plack-api = WARN, PLACKAPI @@ -51,7 +51,7 @@ log4perl.appender.PLACKAPI=Log::Log4perl::Appender::File log4perl.appender.PLACKAPI.filename=__LOG_DIR__/plack-api-error.log log4perl.appender.PLACKAPI.mode=append log4perl.appender.PLACKAPI.layout=PatternLayout -log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKAPI.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKAPI.utf8=1 log4perl.logger.plack-intranet = WARN, PLACKINTRANET @@ -59,5 +59,5 @@ log4perl.appender.PLACKINTRANET=Log::Log4perl::Appender::File log4perl.appender.PLACKINTRANET.filename=__LOG_DIR__/plack-intranet-error.log log4perl.appender.PLACKINTRANET.mode=append log4perl.appender.PLACKINTRANET.layout=PatternLayout -log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m +log4perl.appender.PLACKINTRANET.layout.ConversionPattern=[%d] [%p] %m%n log4perl.appender.PLACKINTRANET.utf8=1 -- 2.39.5