I am using the log4j.properties, and I have an appender called RDev.
I want set the level of RDev appender to DEBUG except for specific packages (HTMLUnit in my case)
My current log4j.properties is like this:
log4j.rootLogger=debug RDev, test
log4j.appender.RDev=org.apache.log4j.RollingFileAppender
log4j.appender.RDev.File=D:/logs
log4j.appender.RDev.MaxFileSize=5mb
log4j.appender.RDev.MaxBackupIndex=10
log4j.appender.RDev.layout=org.apache.log4j.PatternLayout
log4j.appender.RDev.layout.ConversionPattern=[%5p %d{MMM/dd HH:mm:ss}] [%t] (%F:%L) - %m%n
and I want to filter/remove the DEBUG log of these packages:
com.gargoylesoftware.htmlunit
org.apache.commons.httpclient
org.apache.http.impl.conn
*UPDATE * I tried this and it works for all appendars:
# Set specific logger levels.
log4j.logger.org.mortbay.log=fatal
log4j.logger.org.apache.http=fatal
log4j.logger.org.apache.http.headers=fatal
log4j.logger.org.apache.http.wire=fatal
(from https://code.google.com/p/spidey/wiki/HtmlUnitErrors)
Now the question is how to limit this configs to one appendar? (not all of them) (e.g. I want to see the debugs in the file, not console.)