下载log4j程序包
解压缩 tar -zxvf logging-log4j-1.2.13.tar.gz
# cd logging-log4j-1.2.13
# cp dist/lib/log4j-1.2.13.jar /opt/tomcat/server/webapps/manager/WEB-INF/lib/
# cp dist/liblog4j-1.2.13.jar /opt/tomcat/common/lib
vi /opt/tomcat/common/classes/log4j.properties
-------------------------------------------------
#log4j.properties
log4j.rootCategory=DEBUG, CONSOLE, FILE, SYSLOG
log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender
log4j.appender.SYSLOG.SyslogHost=192.168.176.100:514
log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout
log4j.appender.SYSLOG.layout.ConversionPattern=%-4r %-5p %c{2} %M.%L %x
-%m\n
log4j.logger.org.apache=warn
重启 tomcat
阅读(4471) | 评论(0) | 转发(0) |