You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Timo Nentwig <tc...@nitwit.de> on 2003/02/21 20:18:10 UTC

Assigning different priorities to multiple appenders of one logger

Hi!

<category name="MyLogger">
    <priority value="ERROR"/>
    <appender-ref ref="stdout"/>

    <priority value="ALL"/>
    <appender-ref ref="logfile"/>
 </category>

I want MyLogger to write everything (ALL) to a logfile but print only ERRORs
to the console. This seems not to be possible (?!) despite it does make
*very much* sense.

I read about a <filter> tag within <appender> but this one does not work at
all.

Is the above possible at all? A similar question is whether it is possible
to print any (i.e. <root>) ERROR/FATAL to console but write ALL to the
specific <appender>s. By design the set level of <root> does apply to all
children of <root>.

I tried for two days now and it seems not to be possible :-(

Well, and I wonder why it's still <category> and not <logger> (<logger> does
exist but it does not support <priority>, well, actually I did not find any
other doc about it except log4j.dtd at all).

Thank you very much!
Timo
--
http://nitwit.de/
http://www.jeigh.com/werk/admin/



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org