From 2c43e95e0cd108d0a4722f4c96215c278e762fc1 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 1 Apr 2020 08:14:48 -0400 Subject: [PATCH] Bug 15253: Add log4perl conf updates for Debian packages * Add log4perl conf updates for Debian packages * Rename sip2.log to sip.log Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- debian/koha-common.postinst | 16 ++++++++++++++++ debian/templates/log4perl-site.conf.in | 8 ++++++++ etc/log4perl.conf | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/debian/koha-common.postinst b/debian/koha-common.postinst index 2270bd729c..173f700aba 100644 --- a/debian/koha-common.postinst +++ b/debian/koha-common.postinst @@ -173,6 +173,22 @@ EOF fi done +for site in $(koha-list); do + log4perl_config="/etc/koha/sites/$site/log4perl.conf" + if [ !log4perl_component $log4perl_config "sip" ]; then + cat <> $log4perl_config +log4perl.logger.sip = DEBUG, SIP +log4perl.appender.SIP=Log::Log4perl::Appender::File +log4perl.appender.SIP.filename=/var/log/koha/$site/sip.log +log4perl.appender.SIP.mode=append +log4perl.appender.SIP.layout=PatternLayout +log4perl.appender.SIP.layout.ConversionPattern=[%d] [%p] %X{accountid}@%X{peeraddr}: %m %l %n +log4perl.appender.SIP.utf8=1 + +EOF + fi +done + # Bug 14106 - fix the modulePath of existing koha instances so that it'll # continue to work. This will only patch the files if the exact original string # that we're fixing them from is there, so we just run it every time. Maybe diff --git a/debian/templates/log4perl-site.conf.in b/debian/templates/log4perl-site.conf.in index c7de07895b..e43797314c 100644 --- a/debian/templates/log4perl-site.conf.in +++ b/debian/templates/log4perl-site.conf.in @@ -29,3 +29,11 @@ log4perl.appender.API.mode=append log4perl.appender.API.layout=PatternLayout log4perl.appender.API.layout.ConversionPattern=[%d] [%p] %m %l %n log4perl.appender.API.utf8=1 + +log4perl.logger.sip = DEBUG, SIP +log4perl.appender.SIP=Log::Log4perl::Appender::File +log4perl.appender.SIP.filename=__LOG_DIR__/sip.log +log4perl.appender.SIP.mode=append +log4perl.appender.SIP.layout=PatternLayout +log4perl.appender.SIP.layout.ConversionPattern=[%d] [%p] %X{accountid}@%X{peeraddr}: %m %l %n +log4perl.appender.SIP.utf8=1 diff --git a/etc/log4perl.conf b/etc/log4perl.conf index 376b00d5b5..e43797314c 100644 --- a/etc/log4perl.conf +++ b/etc/log4perl.conf @@ -32,7 +32,7 @@ log4perl.appender.API.utf8=1 log4perl.logger.sip = DEBUG, SIP log4perl.appender.SIP=Log::Log4perl::Appender::File -log4perl.appender.SIP.filename=__LOG_DIR__/sip2.log +log4perl.appender.SIP.filename=__LOG_DIR__/sip.log log4perl.appender.SIP.mode=append log4perl.appender.SIP.layout=PatternLayout log4perl.appender.SIP.layout.ConversionPattern=[%d] [%p] %X{accountid}@%X{peeraddr}: %m %l %n -- 2.39.5