Log4J: 2 Appenders - one gets errors, other gets all (doesn't work)
I sent a message to the log4j-user mailing list this afternoon, but have not received a response - so hopefully someone can help me out. Here's the problem I'm having:
I have two appenders - a console and a file. I want all messages to go to the console and only <= error to go to the file. In my file appender, I have a filter to only get the error messages: <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="LevelMax" value="ERROR" /> </filter> Then in <root> I have: <root> <level value="DEBUG"/> <appender-ref ref="CONSOLE"/> <appender-ref ref="FILE"/> </root> From the documentation I've read (i.e. http://tinyurl.com/meef), this *should* work. However, all messages get logged to both the console appender and the file appender.
Any advice is appreciated.