simple question driving me crazy..

I need to have different ROOT logger levels (INFO,DEBUG,WARN,etc) to different appenders (file..) something like: <configuration> <!-- ..... appender defintitions ---- > <root> <level value="debug" /> <appender-ref ref="STDOUT" /> </root> <another root???> <level value="error" /> <appender-ref ref="errorLog" /> </root> </configuration> But I'm not sure how to do this syntax in the XML config file. Looked through the documentation and examples, and I did not see it. Any one can help, I appreciate it... -- Regards, Alex Hoyos

Hi, If I understand, you want to do something like logging to different appenders in function of message level, so maybe you should use http://logback.qos.ch/manual/filters.html Filters which allow to use the root logger with different appenders (in this example, all messages are written to the console, message with level equal to ERROR only are written to file "error-log.txt", message with level equal to WARN only are written to "warn-log.txt" etc.) Hope this helps http://www.nabble.com/file/p12781846/example.txt example.txt Alex Hoyos wrote:
I need to have different ROOT logger levels (INFO,DEBUG,WARN,etc) to different appenders (file..)
something like:
<configuration>
<!-- ..... appender defintitions ---- >
<root> <level value="debug" /> <appender-ref ref="STDOUT" /> </root>
<another root???> <level value="error" /> <appender-ref ref="errorLog" /> </root>
</configuration>
But I'm not sure how to do this syntax in the XML config file. Looked through the documentation and examples, and I did not see it. Any one can help, I appreciate it...
-- Regards,
Alex Hoyos
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- View this message in context: http://www.nabble.com/simple-question-driving-me-crazy..-tf4481778.html#a127... Sent from the Logback User mailing list archive at Nabble.com.

YEP... Thanks for responding promptly. I actually figured this out right after I sent out the posting. But your response reassures me that this is the correct approach. Thank you again mat. On 9/19/07, matg <matthieu.guamis@axege.com> wrote:
Hi,
If I understand, you want to do something like logging to different appenders in function of message level, so maybe you should use http://logback.qos.ch/manual/filters.html Filters which allow to use the root logger with different appenders (in this example, all messages are written to the console, message with level equal to ERROR only are written to file "error-log.txt", message with level equal to WARN only are written to "warn-log.txt" etc.)
Hope this helps http://www.nabble.com/file/p12781846/example.txt example.txt
Alex Hoyos wrote:
I need to have different ROOT logger levels (INFO,DEBUG,WARN,etc) to different appenders (file..)
something like:
<configuration>
<!-- ..... appender defintitions ---- >
<root> <level value="debug" /> <appender-ref ref="STDOUT" /> </root>
<another root???> <level value="error" /> <appender-ref ref="errorLog" /> </root>
</configuration>
But I'm not sure how to do this syntax in the XML config file. Looked through the documentation and examples, and I did not see it. Any one can help, I appreciate it...
-- Regards,
Alex Hoyos
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- View this message in context: http://www.nabble.com/simple-question-driving-me-crazy..-tf4481778.html#a127... Sent from the Logback User mailing list archive at Nabble.com.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Regards, Alex Hoyos

Filters are the way to go as As Matthieu pointed out. You might also want to consider ThresholdFilter described on the same page: http://logback.qos.ch/manual/filters.html Cheers, Alex Hoyos wrote:
YEP... Thanks for responding promptly. I actually figured this out right after I sent out the posting. But your response reassures me that this is the correct approach.
Thank you again mat.
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch
participants (3)
-
Alex Hoyos
-
Ceki Gulcu
-
matg