Bug 3814: SIP2 Server logging doesn't work on OpenSolaris
authorFrédéric Demians <f.demians@tamil.fr>
Fri, 27 Nov 2009 17:16:55 +0000 (18:16 +0100)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Thu, 28 Jan 2010 14:14:52 +0000 (15:14 +0100)
This patch put in SIPconfig.xml SIP2 server logging parameters. This is
way it's possible to modify where SIP2 logs are sent. And fix
OpenSolaris bug.

WARNING: After an upgrade, installation using a custom SIP2 server
config file will need to copy default SIPconfig.xml added section:

<!--
  Set Net::Server::PreFork runtime parameters
  syslog_ident will identify SIP2 Koha server entries in syslog
  For OpenSolaris, add: syslog_logsock=stream
-->
  <server-params
    min_servers='1'
    min_spare_servers='0'
    log_file='Sys::Syslog'
    syslog_ident='koha_sip'
    syslog_facility='local6'
  />

C4/SIP/SIPServer.pm
C4/SIP/SIPconfig.xml

index 55b2380..c6de11e 100644 (file)
@@ -59,16 +59,8 @@ foreach my $svc (keys %{$config->{listeners}}) {
 # Jun 16 21:21:31 server08 steve_sip[19305]: ILS::Transaction::Checkout performing checkout...
 # [  TIMESTAMP  ] [ HOST ] [ IDENT ]  PID  : Message...
 #
-# The IDENT is determined by $ENV{KOHA_SIP_LOG_IDENT}, if present.
-# Otherwise it is "_sip" appended to $USER, if present, or "acs-server" as a fallback.
-#  
+# The IDENT is determined by config file 'server-params' arguments
 
-my $syslog_ident = $ENV{KOHA_SIP_LOG_IDENT} || ($ENV{USER} ? $ENV{USER} . "_sip" : 'acs-server');
-
-push @parms,
-    "log_file=Sys::Syslog",
-    "syslog_ident=$syslog_ident",
-    "syslog_facility=" . LOG_SIP;
 
 #
 # Server Management: set parameters for the Net::Server::PreFork
index 0e5f05e..f229b9a 100644 (file)
@@ -2,10 +2,18 @@
 <!-- above address gets nothing, it's just a namespace -->
   <error-detect enabled="true" />
 
-<!-- Set Net::Server::PreFork runtime parameters -->
-<!--  <server-params
-           min_servers='1'
-           min_spare_servers='0' /> -->
+<!--
+  Set Net::Server::PreFork runtime parameters 
+  syslog_ident will identify SIP2 Koha server entries in syslog
+  For OpenSolaris, add: syslog_logsock=stream
+-->
+  <server-params
+    min_servers='1'
+    min_spare_servers='0' 
+    log_file='Sys::Syslog'
+    syslog_ident='koha_sip'
+    syslog_facility='local6'
+  />
   
   <listeners>
 <!-- vestigial HTTP, never implemented: just use the OPAC!