On May 30, 2008, at 1:40 PM, mli013 wrote:
Hi,
I configured my log4j.xml to enable SYSLOG appender and reference the
appender in my logger, as shown below:
<appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
<layout class="org.apache.log4j.PatternLayout">
</layout>
</appender>
<logger name="filters.LogRequestFilter">
<level value="debug"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="SYSLOG"/>
</logger>
And in /etc/syslog.conf, I specified the following (tab separated
the two
selectors):
# Save user process messages to test_wslog
local2.* /var/log/test_wslog
I am NOT getting anything written to /var/log/test_wslog. Do I have
to do
anything special in my code? I didn't think so. I am just using the
standard LogFactory:
private static final Log LOG =
LogFactory.getLog(LogRequestFilter.class);
.....
LOG.info (".....");
I would really appreciate if someone could shed some light on why the
appender is not outputting my messages to /var/log/test_wslog
Thank you.
Most likely you have syslogd configured to reject messages logged via
UDP sockets. Log4j's SyslogAppender is a pure Java implementation
that fabricates UDP packets and then sends them to the configured
syslog host (default would be localhost). However, most
configurations disable UDP support by default to prevent denial of
service attacks from other machines, but that also kills logging
requests posted via UDP from the same machine.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]