java - What's wrong with my logback syslog appender? -
i'm trying logback syslog appender working, , i've got misconfigured. i've created small sample project think should log syslog, yet doesn't.
i'm sure i'm missing stupid. here's appender logback.xml:
<appender name="syslog" class="ch.qos.logback.classic.net.syslogappender"> <sysloghost>localhost</sysloghost> <facility>user</facility> <suffixpattern>[%thread] %logger %msg</suffixpattern> </appender>
i've tried adding port (514) explicitly, and, no joy. on both systems i've tried on, i've verified syslog receiving input using logger "test message"
, tailing either /var/log/messages or /var/log/system.log.
what need change in order logback/slf4j logging syslog?
nothing wrong code, problem system config. using provided test project, able make syslog appender work (ubuntu 14.10).
here steps:
- edit
/etc/syslog.conf
, ensure have network syslog enabled:
# provides udp syslog reception $modload imudp $udpserverrun 514 # provides tcp syslog reception # note logback seems use udp, isn't strictly necessary. $modload imtcp $inputtcpserverrun 514
- restart rsyslog (
service rsyslog restart
) if change config (reload doesn't work) - check syslog listening
lsof -i | grep syslog
results: