My app logs to console and file (log4net 1.2.11):
<root>
<level value="DEBUG" />
<appender-ref ref="ConsoleAppender" />
<appender-ref ref="RollingLogFileAppender" />
</root>
I'd like to change configuration for one class so that it logs all messages to file, and all but Debug messages to console. Can I do that without adding dedicated appender for my class, and without changing root configuration, e.g. on logger's appender-ref level?
Inspired by this answer, I've tried the code below but without success (all messages, including Debug, are logged to both appenders):
<logger name="MyClass" additivity="false">
<appender-ref ref="ConsoleAppender">
<threshold value="INFO" />
</appender-ref>
<appender-ref ref="RollingLogFileAppender" />
</logger>
This also fails (it excludes Debug from all appenders, and I want Debug messages in file):
<logger name="MyClass">
<level value="INFO" />
</logger>