logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob L. Anawalt" <janaw...@geckosoftware.com>
Subject Re: Using the syslog appender in log4cxx
Date Wed, 04 Jun 2008 00:18:38 GMT
Peter Steele wrote:
> anything appearing in the main syslog file for these applications. What
> other magic do I need to do in log4cxx to get our apps to log to our
> syslog host? We are using the 0.9.7 release.

While this version is no longer supported by the developers, the following 
syslog appender works on my Debian systems running 0.9.7:

         <appender name="SYSLOG" class="org.apache.log4j.SyslogAppender">
                 <param name="Threshold" value="WARN" />
                 <param name="SysLogHost" value="localhost" />
                 <param name="Facility" value="DAEMON" />
                 <layout class="org.apache.log4j.PatternLayout">
                         <param name="ConversionPattern"
                                 value="%-4r %-5p %c %x - %m" />
                 <filter class="LevelRangeFilter">
                         <param name="AcceptOnMatch" value="true"/>
                         <param name="LevelMin" value="WARN" />
                         <param name="LevelMax" value="FATAL" />

To troubleshoot, I'd start simple and go forward. Verify the rest of your 
log4cxx.xml is correct by making sure it will log to the console and then to a 
file. Then I'd try simpler syslog configurations without filters, error handlers 
and using localhost. Going forward from there use tools like logger(1) to verify 
your facility, sysloghost and other settings.

Good luck,
Jacob Anawalt
Gecko Software, Inc.

View raw message