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 ni...@uk.bnpparibas.com on 2005/01/11 12:32:21 UTC

log4j category/appender behaviour -


I have been using log4j for some years now - and thought I knew everything
there was to know... however I have just recently observed behaviour that
suggests I understand bugger all. :-)
(or there is a bug... which I doubt)

If I have a debug logging event

        Logger log = Logger.getLogger("com.moo.boo.hoo");
        log.debug("moooooo");

And I have a root category configuration as follows

        log4j.rootLogger=FATAL, CONSOLE

(CONSOLE is just a ConsoleAppender - I have omitted config for brevity)

I would correctly expect to get NO logging to the console - the event level
(DEBUG) is lower than the appender level (FATAL)...


HOWEVER, if I add a new appender....

        log4j.category.com.moo.boo=DEBUG, FILE

Now, not only do I get "moooooo" logged to the file (which I expect).....
it also appears in the console!
This is *not* what I was expecting. (Nor what any of my colleagues were
expecting)

I dont expect it to appear at the root category because its level is FATAL
- and the log event is DEBUG

It would seem that once an appender triggers, it never checks the level
again as it traverses the category hierarchy...

I doubt its a bug...
What is the rationale for this behaviour? Is there some documentation
covering this?

-Nick



This message and any attachments (the "message") is 
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet 
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

**********************************************************************************************

BNP Paribas Private Bank London Branch is authorised 
by CECEI & AMF and is regulated by the Financial Services
Authority for the conduct of its investment business in the
United Kingdom.

BNP Paribas Securities Services London Branch is authorised
by CECEI & AMF and is regulated by the Financial Services
Authority for the conduct of its investment business in the 
United Kingdom.
  
BNP Paribas Fund Services UK Limited is authorised and 
regulated by the Financial Services Authority.


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


Re: log4j category/appender behaviour -

Posted by Ceki Gülcü <ce...@qos.ch>.
At 03:05 PM 1/11/2005, nick.minutello@uk.bnpparibas.com wrote:


> >> How would you expect the following to behave?
>
>I didnt think that "log4j.logger.com.moo.boo=DEBUG" was even valid
>config... because it didnt specify an appender...

It is a valid configuration directive. However, my question still remains 
unanswered. What behavior do you expect as a result of the two directives?


>-Nick

-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



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


Re: log4j category/appender behaviour -

Posted by ni...@uk.bnpparibas.com.
>> If this was not valid config we would not be able to perform the
>> simplest (and most valuable!) action in a logging API like log4j:
>> "activate debugging in a limited set of packages/classes".

Well, the way I have done this so far is:

     log4j.logger.com.moo.boo=DEBUG, CONSOLE

ie. ", CONSOLE" on the end of the directive....

Usually I have different appenders at these different levels.
Typically, it would look something like:

     # catch-all
     log4j.rootLogger=ERROR, SNMP, SMTP

     # temporary debug logging
     log4j.logger.com.moo.boo=DEBUG, CONSOLE

Except the SNMP & SMTP appenders have had FATAL or ERROR thresholds - and
the logging events would have been discarded (which is why I never noticed
this behaviour)

-Nick






Extranet
diego@datacom-telematica.com.br - 11/01/2005 15:43


Please respond to log4j-user@logging.apache.org



To:    log4j-user

cc:


Subject:    Re: log4j category/appender behaviour -


If this was not valid config we would not be able to perform the
simplest (and most valuable!) action in a logging API like log4j:
"activate debugging in a limited set of packages/classes".

nick.minutello@uk.bnpparibas.com wrote:
>
>>>How would you expect the following to behave?
>
>
> I didnt think that "log4j.logger.com.moo.boo=DEBUG" was even valid
> config... because it didnt specify an appender...
>
>
> -Nick
>
>
>
>
>
>
> Extranet
> ceki@qos.ch - 11/01/2005 13:37
>
>
> Please respond to log4j-user@logging.apache.org
>
>
>
> To:    log4j-user
>
> cc:
>
>
> Subject:    Re: log4j category/appender behaviour -
>
>
>
> Nick,
>
> Before answering your question, perhaps thinking about the following
would
> help.
>
> How would you expect the following to behave?
>
>     log4j.rootLogger=FATAL, CONSOLE
>     log4j.logger.com.moo.boo=DEBUG
>
>
> At 12:32 PM 1/11/2005, nick.minutello@uk.bnpparibas.com wrote:
>
>
>
>>I have been using log4j for some years now - and thought I knew
everything
>>there was to know... however I have just recently observed behaviour that
>>suggests I understand bugger all. :-)
>>(or there is a bug... which I doubt)
>
>
> [cut]
>
>
> --
> Ceki Gülcü
>
>    The complete log4j manual: http://www.qos.ch/log4j/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>
>
> This message and any attachments (the "message") is
> intended solely for the addressees and is confidential.
> If you receive this message in error, please delete it and
> immediately notify the sender. Any use not in accord with
> its purpose, any dissemination or disclosure, either whole
> or partial, is prohibited except formal approval. The internet
> can not guarantee the integrity of this message.
> BNP PARIBAS (and its subsidiaries) shall (will) not
> therefore be liable for the message if modified.
>
>
**********************************************************************************************

>
> BNP Paribas Private Bank London Branch is authorised
> by CECEI & AMF and is regulated by the Financial Services
> Authority for the conduct of its investment business in the
> United Kingdom.
>
> BNP Paribas Securities Services London Branch is authorised
> by CECEI & AMF and is regulated by the Financial Services
> Authority for the conduct of its investment business in the
> United Kingdom.
>
> BNP Paribas Fund Services UK Limited is authorised and
> regulated by the Financial Services Authority.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>

--
DIEGO Moreira da Rosa

DataCom Telemática
Av França, 735 - Porto Alegre, RS - 90230-220
Fone: 51 3358 0112
Fax: 51 3358 0101
www.datacom-telematica.com.br

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



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


Re: log4j category/appender behaviour -

Posted by DataCom - Diego <di...@datacom-telematica.com.br>.
If this was not valid config we would not be able to perform the 
simplest (and most valuable!) action in a logging API like log4j: 
"activate debugging in a limited set of packages/classes".

nick.minutello@uk.bnpparibas.com wrote:
> 
>>>How would you expect the following to behave?
> 
> 
> I didnt think that "log4j.logger.com.moo.boo=DEBUG" was even valid
> config... because it didnt specify an appender...
> 
> 
> -Nick
> 
> 
> 
> 
> 
> 
> Extranet
> ceki@qos.ch - 11/01/2005 13:37
> 
> 
> Please respond to log4j-user@logging.apache.org
> 
> 
> 
> To:    log4j-user
> 
> cc:
> 
> 
> Subject:    Re: log4j category/appender behaviour -
> 
> 
> 
> Nick,
> 
> Before answering your question, perhaps thinking about the following would
> help.
> 
> How would you expect the following to behave?
> 
>     log4j.rootLogger=FATAL, CONSOLE
>     log4j.logger.com.moo.boo=DEBUG
> 
> 
> At 12:32 PM 1/11/2005, nick.minutello@uk.bnpparibas.com wrote:
> 
> 
> 
>>I have been using log4j for some years now - and thought I knew everything
>>there was to know... however I have just recently observed behaviour that
>>suggests I understand bugger all. :-)
>>(or there is a bug... which I doubt)
> 
> 
> [cut]
> 
> 
> --
> Ceki Gülcü
> 
>    The complete log4j manual: http://www.qos.ch/log4j/
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> 
> 
> This message and any attachments (the "message") is 
> intended solely for the addressees and is confidential. 
> If you receive this message in error, please delete it and 
> immediately notify the sender. Any use not in accord with
> its purpose, any dissemination or disclosure, either whole 
> or partial, is prohibited except formal approval. The internet 
> can not guarantee the integrity of this message. 
> BNP PARIBAS (and its subsidiaries) shall (will) not 
> therefore be liable for the message if modified. 
> 
> **********************************************************************************************
> 
> BNP Paribas Private Bank London Branch is authorised 
> by CECEI & AMF and is regulated by the Financial Services
> Authority for the conduct of its investment business in the
> United Kingdom.
> 
> BNP Paribas Securities Services London Branch is authorised
> by CECEI & AMF and is regulated by the Financial Services
> Authority for the conduct of its investment business in the 
> United Kingdom.
>   
> BNP Paribas Fund Services UK Limited is authorised and 
> regulated by the Financial Services Authority.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> 

-- 
DIEGO Moreira da Rosa

DataCom Telemática
Av França, 735 - Porto Alegre, RS - 90230-220
Fone: 51 3358 0112
Fax: 51 3358 0101
www.datacom-telematica.com.br

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


Re: log4j category/appender behaviour -

Posted by ni...@uk.bnpparibas.com.

>> How would you expect the following to behave?

I didnt think that "log4j.logger.com.moo.boo=DEBUG" was even valid
config... because it didnt specify an appender...


-Nick






Extranet
ceki@qos.ch - 11/01/2005 13:37


Please respond to log4j-user@logging.apache.org



To:    log4j-user

cc:


Subject:    Re: log4j category/appender behaviour -



Nick,

Before answering your question, perhaps thinking about the following would
help.

How would you expect the following to behave?

    log4j.rootLogger=FATAL, CONSOLE
    log4j.logger.com.moo.boo=DEBUG


At 12:32 PM 1/11/2005, nick.minutello@uk.bnpparibas.com wrote:


>I have been using log4j for some years now - and thought I knew everything
>there was to know... however I have just recently observed behaviour that
>suggests I understand bugger all. :-)
>(or there is a bug... which I doubt)

[cut]


--
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



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




This message and any attachments (the "message") is 
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet 
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

**********************************************************************************************

BNP Paribas Private Bank London Branch is authorised 
by CECEI & AMF and is regulated by the Financial Services
Authority for the conduct of its investment business in the
United Kingdom.

BNP Paribas Securities Services London Branch is authorised
by CECEI & AMF and is regulated by the Financial Services
Authority for the conduct of its investment business in the 
United Kingdom.
  
BNP Paribas Fund Services UK Limited is authorised and 
regulated by the Financial Services Authority.


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


Re: log4j category/appender behaviour -

Posted by Ceki Gülcü <ce...@qos.ch>.
Nick,

Before answering your question, perhaps thinking about the following would 
help.

How would you expect the following to behave?

    log4j.rootLogger=FATAL, CONSOLE
    log4j.logger.com.moo.boo=DEBUG


At 12:32 PM 1/11/2005, nick.minutello@uk.bnpparibas.com wrote:


>I have been using log4j for some years now - and thought I knew everything
>there was to know... however I have just recently observed behaviour that
>suggests I understand bugger all. :-)
>(or there is a bug... which I doubt)

[cut]


-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



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