JBoss AS 7 logging to Syslog Appender
Posted by joe | Filed under Java, JBoss AS7, Software Development
JBoss AS 7 no longer used the log4j framework for logging, but the java.util.logging classes. What is missing there is a log facility for the old-fashioned UNIX syslog daemon. But this gap can be filled pretty easily by implementing:
- a SyslogHandler for the logging framework, contains the glue code and the message formatting
- a Syslog client which sends the log messages to the syslog daemon
- a module declaration for JBoss AS 7
The code can be found at GitHub: https://github.com/kifj/jboss-syslog
March 3, 2013 at 8:25 am
Hey can I use your jars in a commercial product ? what are the terms of use ?
thanks,
Yoda
March 4, 2013 at 8:37 pm
The code is provided under the GNU General Public License (version 2, with the Classpath Exception).
More or less this allows you to ship it in commercial products (without any problems to the application),
as long as you make changes to this module available under the same licence. Best practice would be to make a fork on github,
keep the licence and give me pull requests if you make any changes.
April 9, 2013 at 9:44 pm
JBoss EAP 6.1.0Alpha contains now a syslog handler as first class element in the logging configuration, which obsoletes this little project by now.
see https://github.com/jbossas/jboss-as/pull/4003 and ticket AS7-6298 for details
April 17, 2013 at 10:38 pm
I’ve download the EAP 6.1 Alpha version, But I could’t find the syslog handler.
Strange because the relase notes says something different.
April 30, 2013 at 6:55 pm
Have a look here:
https://docs.jboss.org/author/display/AS72/Logging+Configuration#LoggingConfiguration-sysloghandler and
A simple syslog handler looks like this:
<syslog-handler name="SYSLOG">
<level name="INFO"/>
<server-address value="loghost.server.lan"/>
<app-name value="jboss-as7"/>
</syslog-handler>