运行 struts 应用程序时出现以下错误。
13/04/19 12:42:21 log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
13/04/19 12:42:21 log4j:WARN Please initialize the log4j system properly.
13/04/19 12:42:21 log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
我的 log4j.properties 文件是:
log4j.threshold=ALL
log4j.rootLogger=ALL,DebugAppender,InfoAppender,RECEIPTAppender
#log4j.rootLogger=DEBUG,DebugAppender
log4j.category.DebugAppender.access=DEBUG
log4j.appender.DebugAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DebugAppender.Threshold=DEBUG
log4j.appender.DebugAppender.File=C:/APWD/ServerLogs/debug/assampwd.log
log4j.appender.DebugAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.DebugAppender.layout.ConversionPattern=%d |[%t]| %-5p |%c |- |%m|%n
#log4j.rootLogger=INFO,InfoAppender
log4j.category.InfoAppender.access=INFO
log4j.appender.InfoAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.InfoAppender.Threshold=INFO
log4j.appender.InfoAppender.File=C:/APWD/ServerLogs/debug/assampwd.log
log4j.appender.InfoAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.InfoAppender.layout.ConversionPattern=%d |[%t]| %-5p |%c |- |%m|%n
#log4j.logger.com.ctmis.hibernate=ERROR, RECEIPTAppender
log4j.category.RECEIPTAppender.access=ERROR
log4j.appender.RECEIPTAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RECEIPTAppender.Threshold=ERROR
log4j.appender.RECEIPTAppender.File=C:/APWD/ServerLogs/debug/assampwd.log
log4j.appender.RECEIPTAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.RECEIPTAppender.layout.ConversionPattern=%d |[%t]| %-5p |%c |- |%m|%n
我的 log4j.properties 文件位于 WEB-INF 文件夹中。我在 stackoverflow 中找到了类似的主题,但对我没有用,所以我发布了它。如果有人可以帮助我,我将不胜感激,这是一条警告消息,但会导致某些模块在应用程序中无法正常工作。
谢谢