Tomcat6配置日志

log4j.properties

log4j.rootLogger=ERROR,R 
 
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n 
 
log4j.appender.R=org.apache.log4j.RollingFileAppender 
log4j.appender.R.File=${catalina.home}/logs/tomcat.log 
log4j.appender.R.MaxFileSize=4MB 
log4j.appender.R.MaxBackupIndex=10 
log4j.appender.R.layout=org.apache.log4j.PatternLayout 
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n 
 
log4j.logger.org.apache.catalina=INFO,R,CONSOLE 

在Tomcat6.0中,

将tomcat-juli-adapters.jar,log4j-1.2.15.jar,log4j.properties复制到D:\Java\ApacheTomcat6.0.14\lib下面.


将tomcat-juli.jar复制到D:\Java\apache-tomcat-6.0.14\bin\下面.


然后启动tomcat,就可以在D:\Java\apache-tomcat-6.0.14\logs下看到lizongbo.log了.

你可能感兴趣的:(tomcat6)