(I)

Yes, I did not know about the appender threshold.  Thanks for the replies ... 
the information was exactly what I was looking for!

Is there anything that does the "complement" of this threshold (i.e., appender 
should keep log only if it falls outside [instead of inside] the threshold)?  
This would be most useful to route FATAL/ERROR/WARN to a stdout ConsoleAppender 
and all other logs to a stdout ConsoleAppender.

(II)

I now have a different question:

Suppose my logger tree is:
    rootLogger
    foo
    bar
and
    addivity is default (true)

How can I configure the following?

    "foo" logger level is ALL

    "bar" logger level is ALL

    File A contains all "foo" logs and just FATAL/ERROR/WARN "bar" logs

    File B contains all "bar" logs

Do I need to write some custom appender to achieve this?

The above configuration would be useful in generating a nearly complete log 
(file A) for my own analysis and an extremely verbose debug log (file B) to 
help the the maintainer of "bar" related code.

- Howard


----- Original Message -----
From: Blok, Eelke <[EMAIL PROTECTED]>
To: Log4J Users List <log4j-user@logging.apache.org>
Sent: Tue Dec 18 02:56:43 2007
Subject: RE: parent logger to filter child logger by level

Just one additional comment, although implicit in Curt's comment, I
think Howard is/was missing the fact there is a difference between
logger level and appender threshold.

The logger level (either explicitly set or implicitly inherited)
controls whether a log messags enters the tree (after that, it is not
affected by the level of any loggers it passes whil traversing the
tree).
If the log message then reaches an appender, the *appender's* threshold
(which has nothing to do with the level of the logger that appender is
attached to) determines if the log message is actually processed by the
appender.

-----Original Message-----
From: Curt Arnold [mailto:[EMAIL PROTECTED]
Sent: maandag 17 december 2007 21:57
To: Log4J Users List
Subject: Re: parent logger to filter child logger by level


On Dec 17, 2007, at 1:50 PM, Mak, Howard wrote:

> Thanks for your response.
>
> Here is what I'm trying to achieve:
>
> (1)     File A contains all logs
> (2)     File B contains only the FATAL/ERROR/WARN logs in file A
>
> In other words, (2) provides a bird's eye view of problems that can be

> easily missed when reading in (1) (which can be quite big).
>
> Is my only option to write a filter-by-Level appender to be used by
> (1)?
>
> - Howard
>

Set the level on rootLogger to ALL, attach two appenders to the root
logger, set the threshold on the second appender to WARN.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to