Bug 15253: Add log4perl conf updates for Debian packages
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 1 Apr 2020 12:14:48 +0000 (08:14 -0400)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 12 May 2020 10:46:52 +0000 (11:46 +0100)
* Add log4perl conf updates for Debian packages
* Rename sip2.log to sip.log

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

debian/koha-common.postinst
debian/templates/log4perl-site.conf.in
etc/log4perl.conf

index 2270bd7..173f700 100644 (file)
@@ -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 <<EOF >> $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
index c7de078..e437973 100644 (file)
@@ -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
index 376b00d..e437973 100644 (file)
@@ -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