如何在log4j中设置属性把struts2的debug信息去掉

 

struts2 在发开时,控制台如输出大量信息,太烦人了,内容如下 :

 

2009-03-28 19:20:37,109  WARN (com.opensymphony.xwork2.ognl.OgnlValueStack:45) - Could not find property [templateDir]
2009-03-28 19:20:37,109  WARN (com.opensymphony.xwork2.ognl.OgnlValueStack:45) - Could not find property [templateDir]
2009-03-28 19:20:37,125  WARN (com.opensymphony.xwork2.ognl.OgnlValueStack:45) - Could not find property [templateDir]
2009-03-28 19:20:37,125  WARN (com.opensymphony.xwork2.ognl.OgnlValueStack:45) - Could not find property [templateDir]
2009-03-28 19:20:37,250  WARN (com.opensymphony.xwork2.ognl.OgnlValueStack:45) - Could not find property [org.apache.catalina.jsp_file]

...

...

...

 

 

解决方法:

在log4j.properties  文件中加入:

 

log4j.logger.com.opensymphony.xwork2=ERROR

 

世界清静了..................

你可能感兴趣的:(STRUTS,2)