logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: log.info prints exceptios
Date Mon, 05 Nov 2007 23:40:03 GMT

On Nov 5, 2007, at 4:11 PM, Amnon Lahav wrote:

>
> when exceptions are thrown from within the info try catch they  
> still get printed out in the info log and not in the warn , the  
> wanr allso prints them but i don't want info.log to do it as well ?
>


Could you clarify that sentence, I'm not sure what you are trying to  
say.

 From your configuration code, you have three log files, info.log,  
warn.log, and error.log.  The info.log file would be expected to have  
any log request of level info and higher, warn.log would have any  
request of level warn and higher and error.log would have any request  
of level error and higher.

You log an exception object as the message for an error level  
request.  The toString() value of the exception would be expected to  
appear in all three files.  The code is legal, any object can be  
passed as a message and have its toString() method called to get the  
message text.  But it is much more common to pass an exception as the  
second arg on a log request like:

logger.error("Exception during data operation", e);

Threshold sets the lower limit of the logging requests processed by  
an appender.  If you want to limit info.log to be only messages with  
the INFO level, you would have to use a filter.

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


Mime
View raw message