Open f1-outsourcing opened 2 years ago
Did you try native Log4J syslog appender ?
log4j.appender.Syslog=org.apache.log4j.net.SyslogAppender
log4j.appender.Syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.Syslog.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c %x - %m%n
log4j.appender.Syslog.syslogHost=localhost
log4j.appender.Syslog.facility=LOCAL1
log4j.appender.Syslog.threshold=debug
Currently I am logging directly to the remote syslog with this, but it took me quite some time getting it to work. I also struggle with the logging format, so it is 'syslog' compatible. It would have helped me a lot if there was just an example file.
If I compare your line log4j.appender.Syslog.syslogHost=localhost with mine, I would assume that packets are just being send to 127.0.0.1 port 514. I have this running in a container and I can't be sure that a remote syslog is available, that is why I want to log to /dev/log that volume is always available.
webapps/davmail/WEB-INF/classes/log4j.properties
log4j.rootLogger=INFO, syslog
log4j.appender.syslog=org.apache.log4j.net.SyslogAppender
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
;log4j.appender.syslog.layout.ConversionPattern=davmail: [%c] [%t] >> ${hostName} %M - %msg%xEx%n
log4j.appender.syslog.layout.ConversionPattern=davmail: %M - %m
log4j.appender.syslog.syslogHost=xxxx.xxx.xx
log4j.appender.syslog.facility=LOCAL1
log4j.appender.syslog.threshold=INFO
Please add config sample of logging to syslog at /dev/log