small documentation fixes about logging

Guillaume Rousse guillaume.rousse at renater.fr
Wed Apr 18 05:08:51 EDT 2018


Hello list.

Here are a few documentation issues I found yesterday while trying to 
enhance my SP logging configuration.

First, the page 
https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPLogRotation 
mentions:
The Shibboleth SP comes with logging capabilities provided by log4cpp, 
which includes the DailyRollingFileAppender

That's wrong, as log4cpp doesn't support DailyRollingFileAppender, only 
RollingFileAppender.

Second, the content of the sample syslog.logger file shipped with SP 
could be enhanced to facilite its usage, without having to read log4shib 
source code (I couldn't find any documentation).

Currently, it is:
log4j.appender.syslog=org.apache.log4j.SyslogAppender
log4j.appender.syslog.syslogName=shibboleth
#log4j.appender.syslog.layout=org.apache.log4j.BasicLayout
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.syslog.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S} %p 
%c %x: %m%

- "SyslogAppender" type works, however usage of "LocalSyslogAppender" or 
"RemoteSyslogAppender" as appender type is mandatory to have actual 
preferences values passed to the appender

- There is no string to value decoding implemented for syslog facility, 
meaning numerical value has to be used for facility:
log4j.appender.syslog.facility=18

- the layout pattern used duplicate native timestamping of syslog, and 
should better be:
log4j.appender.syslog.layout.ConversionPattern=%p %c %x: %m%

So, I'd rather recommend this kind content for this file:
log4j.appender.syslog=org.apache.log4j.RemoteSyslogAppender
log4j.appender.syslog.syslogHost=my.syslog.host
log4j.appender.syslog.syslogName=shibboleth
log4j.appender.syslog.facility=16 # local0
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.syslog.layout.ConversionPattern=%p %c %x: %m%

Last, as this file is actually not used by default, it should not get 
installed under /etc/shibboleth directory, but rather among 
documentation. I've seen a few mails in this list archive confused by 
the fact than just editing it was not sufficient to activate syslog.

The attached patches addresses the two last issues.

Regards.
-- 
Guillaume Rousse
Pôle SSI

Tel: +33 1 53 94 20 45
www.renater.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-better-syslog-logger-example.patch
Type: text/x-patch
Size: 1194 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/users/attachments/20180418/f8431236/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-do-not-install-sample-files-as-configuration-but-doc.patch
Type: text/x-patch
Size: 1614 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/users/attachments/20180418/f8431236/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3637 bytes
Desc: Signature cryptographique S/MIME
URL: <http://shibboleth.net/pipermail/users/attachments/20180418/f8431236/attachment.p7s>


More information about the users mailing list