From abb8c0937d99474bfb08c15cb3fe9f52c9a74a96 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 --- debian/koha-common.postinst | 19 +++++++++++++++++++ debian/templates/log4perl-site.conf.in | 11 +++++++++++ etc/log4perl.conf | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/debian/koha-common.postinst b/debian/koha-common.postinst index bdc55016e6..8942b2aef9 100644 --- a/debian/koha-common.postinst +++ b/debian/koha-common.postinst @@ -160,6 +160,25 @@ 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.create_at_logtime=true +log4perl.appender.SIP.syswrite=true +log4perl.appender.SIP.recreate=true +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 dbf544466a..c07f9ba66b 100644 --- a/debian/templates/log4perl-site.conf.in +++ b/debian/templates/log4perl-site.conf.in @@ -21,3 +21,14 @@ log4perl.appender.Z3950.mode=append log4perl.appender.Z3950.layout=PatternLayout log4perl.appender.Z3950.layout.ConversionPattern=[%d] [%p] %m %l %n log4perl.appender.Z3950.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.create_at_logtime=true +log4perl.appender.SIP.syswrite=true +log4perl.appender.SIP.recreate=true +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 0b740d6075..e7a0f67c6d 100644 --- a/etc/log4perl.conf +++ b/etc/log4perl.conf @@ -30,7 +30,7 @@ log4perl.appender.Z3950.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.create_at_logtime=true log4perl.appender.SIP.syswrite=true -- 2.24.1 (Apple Git-126)