How can I configure Logback to log different levels for a logger to different destinations?
For example, given the following Logback configuration, will Logback reco
I take no credit for this answer, as it's merely a combination of the best two answers above: that of X. Wo Satuk and that of Sébastien Helbert: ThresholdFilter is lovely but you can't configure it to have an upper level as well as a lower level*, but combining it with two LevelFilters set to "DENY" WARN and ERROR works a treat.
Very important: do not forget the tag in the STDERR appender: my omission of it had me frustrated for a few minutes.
INFO
WARN
DENY
ERROR
DENY
%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M\(%line\)
- %msg%n
WARN
System.err
%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M\(%line\)
- %msg%n
* it does however have a method decide in the API but I haven't a clue how you'd use it in this context.