Take a look at org.apache.log4j.varia.LevelMatchFilter and LevelRangeFilter. Example:
<root> <level value="debug"/> <appender-ref ref="err.log" /> <appender-ref ref="out.log" /> </root> <appender name="out.log" class="org.apache.log4j.FileAppender"> <param name="Append" value="true" /> <param name="File" value="log/out.log" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%d{DATE}] %5p [%t] (%F:%M:%L) - %m%n" /> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="LevelMin" value="DEBUG" /> <param name="LevelMax" value="INFO" /> <param name="AcceptOnMatch" value="true" /> </filter> <filter class="org.apache.log4j.varia.DenyAllFilter"/> </appender> <appender name="err.log" class="org.apache.log4j.FileAppender"> <param name="Append" value="true" /> <param name="File" value="log/err.log" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%d{DATE}] %5p [%t] (%F:%M:%L) - %m%n" /> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="LevelMin" value="WARN" /> <param name="LevelMax" value="FATAL" /> <param name="AcceptOnMatch" value="true" /> </filter> <filter class="org.apache.log4j.varia.DenyAllFilter"/> </appender> On Fri, 2002-09-27 at 09:51, Johannes Carlén wrote: > Hi, > I'd like to have multiple appenders to a single > category. That is, for example, log all debug messages > to console and all errors to file. I have read that > you could set a threshold on an appender, but I > haven't been able to figure out how. Strangely enough! > This must be a very common requirement... > > Does anyone have an example of an xml-config for this? > > Thanks > /Johannes > > _____________________________________________________ > Gratis e-mail resten av livet pĺ www.yahoo.se/mail > Busenkelt! > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- []'s Daniel Serodio -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>