Testing Syslog is working

vi /etc/sysconfig/syslog

 sysLOGD_OPTIONS = “-r –m 0”   ## -r 意思是接受远程的日志

 

vi /etc/syslog.conf       
 

service syslog restart

 

logger -p local5.warning "willim worked"
 

nc -w0 -u 192.168.0.1 514 <<< "testing again from my home machine"

 

echo "User Info msg from remote through UDP." | nc -w0 -u nabasiavm5 514 <<< "GGGGGGGGGG"

 

 log4j.logger.syslog =DEBUG, syslogApp
# Appender configuration
log4j.appender.syslogApp=org.apache.log4j.net.SyslogAppender
log4j.appender.syslogApp.SyslogHost=111.111.111.102
log4j.appender.syslogApp.layout=org.apache.log4j.PatternLayout
log4j.appender.syslogApp.layout.ConversionPattern=%m

你可能感兴趣的:(syslog)