Tomcat6下的log4j配置问题

10-07-07 bibi1891
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

#
# Application logging options
#
log4j.logger.com.jdon=DEBUG
log4j.logger.org.apache=DEBUG
log4j.logger.org.apache=INFO
log4j.logger.org.apache.struts=DEBUG
log4j.logger.org.apache.struts=INFO

如果把log4j.rootLogger=DEBUG, R的去掉就没问题。这样对吗?
当启动Jdon框架任何一个应用程序,后台日志也没有出现:
<======== Jdon Framework started successfully! =========>
请问怎么配置。


2
猜你喜欢