- RedHat JBoss Enterprise Application Platform (EAP)
- It looks like the JBoss
SyslogHandlerhas support for TCP, but I can't see how to configure it. How can I do this?
While the ability to use TCP in the
SyslogHandlerhas in fact been added to EAP 6.2, the ability to configure this directly in the CLI/web console has not been added.
That said, you can configure the
SyslogHandlerwith TCP if you configure it as a
custom-handler. Because the custom configuration can be admittedly brittle, here's a sample configuration:
<custom-handler name="SYSLOG" class="org.jboss.logmanager.handlers.SyslogHandler" module="org.jboss.logmanager"> <encoding value="ISO-8859-1"/> <formatter> <pattern-formatter pattern="%-5p [%c] (%t) %s%E%n"/> </formatter> <properties> <property name="appName" value="JBossEAP"/> <property name="facility" value="LOCAL_USE_5"/> <property name="serverHostname" value="localhost"/> <property name="hostname" value="-"/> <property name="port" value="1119"/> <property name="syslogType" value="RFC5424"/> <property name="protocol" value="TCP"/> <property name="messageDelimiter" value="-"/> <property name="useMessageDelimiter" value="true"/> </properties> </custom-handler>
- Encoding is set to
ISO-8859-1to avoid the UTF-8 BOM being added to the messages per spec 1
- The date is removete from the standard pattern-formatter since the date is already part of the syslog spec message
- The message delimiter should probably be changed. The default value of "\n" will literally add "\n" to the message, i.e. it won't actually add a newline character.
- Most syslog implementations expect to see a linefeed as the delimiter. Since we need to use XML escaping, that would be configured as:
<property name="messageDelimiter" value=" "/>
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.