Testing Syslog is working

xyc 2012-07-26

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

#Appenderconfiguration

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

相关推荐

月月鸟个人 / 0评论 2012-07-03