log4j/log4cxx: log to two different files with different levels
If you want to log to two different files (works with other appenders too) with two different log levels use the LevelRangeFilter in the appender. A config will look like this:
<appender name="logfile" class="org.apache.log4j.rolling.RollingFileAppender">
...
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="INFO"/>
<param name="AcceptOnMatch" value="true"/>
</filter>
</appender>
Written by Stefan Weigand
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Logging
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#