You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Daniil Kolpakov <Da...@ctxm.com> on 2007/11/28 14:41:08 UTC
Logging to syslog server via TCP instead of UDP
Hi everyone!
I've came here with a little patch to allow SyslogAppender use TCP instead of
UDP as transport.
TCP syslog is not standartized, but supported by numerous syslog servers
nevertheless. Here at CTXM we are required to log to a syslog server via TCP
because of some firewall issues.
Usage is something like this:
----------------------------------------
# file log4j.properties
log4j.rootCategory=ALL, SyslogApender
log4j.appender.SyslogApender=org.apache.log4j.net.SyslogAppender
log4j.appender.SyslogApender.layout=org.apache.log4j.PatternLayout
log4j.appender.SyslogApender.layout.ConversionPattern=[%-5p] %c{1} - %m%n
# note the "tcp:" prefix
log4j.appender.SyslogApender.syslogHost=tcp:localhost:514
----------------------------------------
The patch is against Log4J 1.2.15. The @since tag in the TCPSyslogWriter and
the "version" property in build.xml probably needs to be corrected :)
--
Daniil V. Kolpakov
Software developer
CTXM SIA
www.ctxm.com
--
This message has been scanned for viruses and
dangerous content and is believed to be clean.