geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Blewitt <Alex.Blew...@ioshq.com>
Subject Re: [Exceptions] [i18n] Hardcoded message strings
Date Fri, 29 Aug 2003 07:33:04 GMT
On Friday, Aug 29, 2003, at 00:35 Europe/London, gianny DAMOUR wrote:

> Alex wrote:
>> For logging exceptions, I strongly think that the logging mechanism 
>> should do:
>>
>> log(e.getClass() + ":" + e.getLocalizedMessage());
>>   or
>> log(e.toString())
>>
>> rather than
>>
>> log(e.getMessage())
>
> I see a problem in both cases: the stack trace - the exact location 
> where the exception has been thrown - is lost.
>
> Personally, I always use:
> log.error("additional information", yourException);

Agreed. I should have been clearer in what I meant; the underlying 
logging mechanism should always print out the LocalistedMessage instead 
of the Message, and also ensure that the class name is printed out as 
well.

Alex.


Mime
View raw message