In a previous version of Jboss I was able to configure a SYSLOG appender with the following configuration in jboss-log4j.xml:
<appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Facility" value="LOCAL7"/>
<param name="FacilityPrinting" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/>
</layout>
</appender>
Now I’ve upgraded to Jboss AS 7 and it seems like this should go in the $JBOSS_HOME/standalone/configuration/standalone.xml but the syntax is different.
My question is: How do I configure Jboss AS 7 to use a SYSLOG appender?
log4j is no longer used in JBoss AS 7 there for there is no syslog appender. You would have to find or develop a custom
java.util.logging.Handlerif you want something similar.Once the handler is created it’s probably best to make it a module. Let’s say the handler was called
com.example.logging.SysLogHandler. In$JBOSS_HOME/modulescreate a directory calledcom/example/logging/main. In that directory place your library and create anmodule.xmlfile, see another module for an example.module.xml example:
You can now edit the
standalone.xmlto add a custom handler.