Carl Hörberg Asked: 2012-01-20 08:09:14 +0800 CST2012-01-20 08:09:14 +0800 CST 2012-01-20 08:09:14 +0800 CST How to configure JBoss AS 7 to log to syslog? 772 How do i configure jboss to log to syslog? jboss syslog rsyslog 3 Answers Voted Doug 2012-01-20T08:13:24+08:002012-01-20T08:13:24+08:00 Putting something like: <!-- Syslog events --> <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"/> <param name="SyslogHost" value="localhost"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/> </layout> </appender> in your log4j.conf would work... Just make sure to tune it down to what you actually want, just uses standard log4j context, you definitely wouldn't want all of your jvm logs to be spitting out to syslog in most app server configs... user157726 2013-04-13T02:18:49+08:002013-04-13T02:18:49+08:00 I am using this: https://github.com/kifj/jboss-syslog <profile> <subsystem xmlns="urn:jboss:domain:logging:1.2"> + <custom-handler name="SYSLOG" class="x1.jboss.syslog.SyslogHandler" module="x1.jboss-syslog"> + <level name="INFO"/> + <properties> + <property name="loghost" value="localhost"/> + <property name="application" value="jboss-as7"/> + </properties> + </custom-handler> <console-handler name="CONSOLE"> <level name="INFO"/> <formatter> @@ -89,8 +100,7 @@ <root-logger> <level name="INFO"/> <handlers> - <handler name="CONSOLE"/> - <handler name="FILE"/> + <handler name="SYSLOG"/> </handlers> </root-logger> </subsystem> for access log it still does not work. the tag wants to write to file, and have no idea how to use a custom logger there. Slawomir Jaranowski 2016-07-07T00:43:51+08:002016-07-07T00:43:51+08:00 JBoss AS 7.2 has syslog handler, so you can use: <syslog-handler name="SYSLOG"> <level name="DEBUG" /> <server-address value="<syslog.server>"/> <port value="<syslog.port>"/> </syslog-handler> ... <root-logger> <handlers> ... <handler name="SYSLOG" /> ... </handlers> </root-logger> More info in documentation: https://docs.jboss.org/author/display/AS72/Admin+Guide#AdminGuide-sysloghandler
Putting something like:
in your log4j.conf would work... Just make sure to tune it down to what you actually want, just uses standard log4j context, you definitely wouldn't want all of your jvm logs to be spitting out to syslog in most app server configs...
I am using this: https://github.com/kifj/jboss-syslog
for access log it still does not work. the tag wants to write to file, and have no idea how to use a custom logger there.
JBoss AS 7.2 has syslog handler, so you can use:
More info in documentation: https://docs.jboss.org/author/display/AS72/Admin+Guide#AdminGuide-sysloghandler