Posted By:
Christopher_Koenigsberg
Posted On:
Wednesday, September 3, 2003 06:48 AM
Collect the most frequent unnecessary log message from your log file and see what logger names they use. Then add lines for each one, in your log4j.properties file, turning off everything except WARN and above (e.g., stop DEBUG and INFO messages).
For instance (we probably don't need all of these lines, but this works, and that's good enough since I can't waste more time on this):
log4j.logger.org.apache=WARN
log4j.logger.org.apache.threshold=WARN
log4j.logger.org.apache.threshold=WARN
log4j.logger.org.apache.commons.threshold=WARN
log4j.logger.org.apache.commons.digester.threshold=WARN
log4j.logger.org.apache.commons.digester.Digester=WARN
log4j.logger.org.apache.struts.util.PropertyMessageResources=WARN
log4j.logger.org.apache.struts.util.PropertyMessageResources.threshold=WARN
log4j.logger.org.apache.struts.action.ActionServlet=WARN
log4j.logger.org.apache.struts.action.ActionServlet.threshold=WARN
log4j.logger.org.apache.commons.beanutils.MethodUtils=WARN
log4j.logger.org.apache.commons.beanutils.MethodUtils.threshold=WARN
log4j.logger.org.apache.commons.beanutils.BeanUtils=WARN
log4j.logger.org.apache.commons.beanutils.BeanUtils.threshold=WARN
log4j.logger.org.apache.commons.beanutils.ConvertUtils=WARN
log4j.logger.org.apache.commons.beanutils.ConvertUtils.threshold=WARN
This works to cut nearly everything off, on a Tomcat server. On a JBoss server, we have loads more crap coming with "org.jboss" etc. so we add additional lines to turn it off. On a Weblogic server, similar deal, etc.