Tomat6启动后,控制台出现警告: log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources). log4j:WARN Please initialize the log4j system properly.
log4j.properties如下: # # Configures Log4j as the Tomcat system logger #
# # Configure the logger to output info level messages into a rolling log file. # log4j.rootLogger=DEBUG, R
# # To continue using the "catalina.out" file (which grows forever), # comment out the above line and uncomment the next. # log4j.rootLogger=INFO, A1
# # Configuration for standard output ("catalina.out"). # log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout # # Print the date in ISO 8601 format # log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# # Configuration for a rolling log file ("tomcat.log"). # log4j.appender.R=org.apache.log4j.DailyRollingFileAppender log4j.appender.R.DatePattern='.'yyyy-MM-dd # # Edit the next line to point to your logs directory. # The last part of the name is the log file name. # log4j.appender.R.File=D:/tomcat6.0/logs/tomcat.log log4j.appender.R.layout=org.apache.log4j.PatternLayout # # Print the date in ISO 8601 format # log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n