I am having following xml config for log4j with 3 appenders. And want to configure logger the following way:
All messages more than INFO are written to STDOUT and global log FILE appenders
But for some class Oauth I want to have extra log file OAUTHFILE
Some classes are filtered and write messages to LOG only on error level this can be achieved by
<logger name="application" level="ERROR" />
some classes are filtered and write messages to its own log file. This is also solved with additivity equal false flag.
<logger name="MapActor" level="DEBUG" additivity="false"> <appender-ref ref="MAPACTORFILE" /> </logger>
But how can I solve the 2nd problem. The folowing configuration produces debug and error messages in STDOUT and! in OAUTHFILE
<configuration>
...
<appender name="STDOUT" ...></appender>
<appender name="FILE" ...>
</appender>
<appender name="OAUTHFILE" ...>
</appender>
...
<logger name="controllers.OAuth" level="DEBUG" additivity="false">
<appender-ref ref="OAUTHFILE" />
</logger>
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>