AVOIDING DEFAULT LOG WHILE IAM USING LOG4J EXCLUSIVELY
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ravi_sambandam
Posted On:   Wednesday, September 3, 2003 01:37 AM


			
hai,

when i log using log4j,in the log file i also get the default log info because of which the file size becomes huge.
how 2 avoid this.i just only want the log which i do

example for log of struts which i got in the log file




regards,
ravi sambandam

Re: AVOIDING DEFAULT LOG WHILE IAM USING LOG4J EXCLUSIVELY

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.

About | Sitemap | Contact