aspose file tools*
The moose likes JBoss/WildFly and the fly likes Syslog with Jboss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Syslog with Jboss" Watch "Syslog with Jboss" New topic
Author

Syslog with Jboss

Jessica Plunkett
Greenhorn

Joined: Aug 20, 2007
Posts: 7
I am running jboss 4.2.3 on a SLES 10 server. I am trying to redirect the logs to another server but I am running into issues. I have uncommented the following section in my jboss-log4j.xml file:

<appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Facility" value="LOCAL3"/>
<param name="FacilityPrinting" value="true"/>
<param name="SyslogHost" value="10.192.134.44"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
</layout>
</appender>

And added the syslog line under root:

<root>
<!--appender-ref ref="CONSOLE"/>-->
<appender-ref ref="SYSLOG"/>
<appender-ref ref="FILE"/>
</root>

When I start jboss - I don't get any errors but the logs are not showing up on the remote server. I restarted the syslog service. The system logs for this server are showing up on the remote server so I think syslog is configured correctly. Thanks in advance for any help.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

Try setting the log4j.debug property (add -Dlogj4.debug or -Dlogj4.debug=true to the JVM options). This option causes log4j to print out its own debugging information which might help point out what the problem is.


JBoss In Action
Jessica Plunkett
Greenhorn

Joined: Aug 20, 2007
Posts: 7
Thanks for replying! I added in that option and I don't see any info in the log related to this issue. Do you have any other suggestions?
Jessica Plunkett
Greenhorn

Joined: Aug 20, 2007
Posts: 7
One more question - when I was reading through google, it seemed like most of the post were using UDP. I have syslog-ng configured for TCP - do I have to use UDP for jboss?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

People use UDP for logging because it is a lighter weight protocol - messages are not guaranteed to be delivered, and might not be delivered in the same order as sent. Not sure if that is what is causing problems for you or not (I haven't tried logging to syslog myself.)
Jessica Plunkett
Greenhorn

Joined: Aug 20, 2007
Posts: 7
In case anyone else runs into this - I couldn't find a way to make syslog use TCP - I opened the UDP port on my server and now syslog for jboss is working.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Syslog with Jboss