[logback-user] How to output all errors to console, and errors+mesgs to logfile?

Rob rmh83 at comcast.net
Sun Feb 14 00:05:28 CET 2010


I'm a new user and struggling to achieve the following:
1) All "error" messages must go to stdout and a logfile.
2) Based on com.example.myclass level settings, messages also go to logfile.

My problem is I can't get both requirement 1 and 2 working simultaneously. 
The following results in debug messages going to the console.  Using 
additivity="false" results in errors from com.example.myclass not going to the 

Any suggestion is welcome!

	<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
	<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">

	<logger name="com.example.myclass" level="debug">
		<appender-ref ref="ROLLING"/>

	<root level="error">
		<appender-ref ref="CONSOLE"/>
		<appender-ref ref="ROLLING"/>


More information about the Logback-user mailing list