You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by mli013 <ma...@solers.com> on 2008/05/30 20:40:13 UTC

SyslogAppender does not work

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.

-- 
View this message in context: http://www.nabble.com/SyslogAppender-does-not-work-tp17565633p17565633.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: SyslogAppender does not work

Posted by Curt Arnold <ca...@apache.org>.
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: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: SyslogAppender does not work

Posted by mli013 <ma...@solers.com>.
Yeah,  the message does show up in /var/log/test_wslog.


Douglas_E_Wegscheid wrote:
> 
> If you use the Unix/Linux "logger" command, does anything show up? that 
> would narrow it down to whether or not it is a syslog configuration 
> problem, or a log4j problem....
> 
> logger -p local.warn Testing
> 
> Douglas E Wegscheid
> Lead Technical Analyst, Whirlpool Corporation
> 
> "A wrong note played hesitatingly is a wrong note. A wrong note played 
> with conviction is interpretation."
> 
> 
> 
> 
> 
> mli013 <ma...@solers.com> 
> 05/30/2008 02:40 PM
> Please respond to
> "Log4J Users List" <lo...@logging.apache.org>
> 
> 
> To
> log4j-user@logging.apache.org
> cc
> 
> Subject
> SyslogAppender does not work
> 
> 
> 
> 
> 
> 
> 
> 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.
> 
> -- 
> View this message in context: 
> http://www.nabble.com/SyslogAppender-does-not-work-tp17565633p17565633.html
> 
> Sent from the Log4j - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/SyslogAppender-does-not-work-tp17565633p17566631.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: SyslogAppender does not work

Posted by Do...@whirlpool.com.
If you use the Unix/Linux "logger" command, does anything show up? that 
would narrow it down to whether or not it is a syslog configuration 
problem, or a log4j problem....

logger -p local.warn Testing

Douglas E Wegscheid
Lead Technical Analyst, Whirlpool Corporation

"A wrong note played hesitatingly is a wrong note. A wrong note played 
with conviction is interpretation."





mli013 <ma...@solers.com> 
05/30/2008 02:40 PM
Please respond to
"Log4J Users List" <lo...@logging.apache.org>


To
log4j-user@logging.apache.org
cc

Subject
SyslogAppender does not work







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.

-- 
View this message in context: 
http://www.nabble.com/SyslogAppender-does-not-work-tp17565633p17565633.html

Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org