当前位置: 代码迷 >> J2EE >> 如何去掉com.opensymphony.xwork2.util.logging.commons.CommonsLogger的error信息
  详细解决方案

如何去掉com.opensymphony.xwork2.util.logging.commons.CommonsLogger的error信息

热度:284   发布时间:2016-04-22 01:40:28.0
怎么去掉com.opensymphony.xwork2.util.logging.commons.CommonsLogger的error信息
log4j中我想关闭以下输出,但一直关不上
[WARN ] 2012-04-22 08:30:02,750 method:com.opensymphony.xwork2.util.logging.commons.CommonsLogger.warn(CommonsLogger.java:56)
Could not find token mapped to token name struts.token

log4j.properties文件

log4j.rootLogger=error,CONSOLE,DAILY_ROLLING_FILE
#DEBUG,CONSOLE,FILE,ROLLING_FILE,MAIL,DATABASE

log4j.addivity.org.apache=true

log4j.logger.org.apache=WARN
log4j.logger.com.opensymphony.xwork2=error
log4j.addivity.com.opensymphony.xwork2=true


###################
# Console Appender
###################
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.Threshold=DEBUG
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d - %c -%-4r [%t] %-5p %c %x - %m%n
#log4j.appender.CONSOLE.layout.ConversionPattern=[start]%d{DATE}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD] n%c[CATEGORY]%n%m[MESSAGE]%n%n

########################
# DailyRolling File
########################
log4j.appender.DAILY_ROLLING_FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DAILY_ROLLING_FILE.file=c:/logZHCP/daily.log
log4j.appender.DAILY_ROLLING_FILE.DatePattern='.'yyyy-MM-dd
log4j.appender.DAILY_ROLLING_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.DAILY_ROLLING_FILE.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n


------解决方案--------------------
log4j.logger.org.apache=WARN
注释掉试试。
  相关解决方案