logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Hosier" <da...@longviewsoftware.com>
Subject RE: Logger vs. Appender
Date Thu, 11 May 2006 14:17:25 GMT
Yes, it's working for me like a charm as well.  I just created a class
hierarchy for logging events.  Then I created an Appender and narrowed that
appender to only be used with very specific Categories.  Then in my code I
create a Logger for those specific Categories and pass instances of my
logging objects to the log calls.  On a database error, I even pass the
toString() of my logging objects up to the super Appender so that at least
something gets logged.  Thanks for the suggestions on this issue. 

-----Original Message-----
From: paul womack [mailto:pwomack@papermule.co.uk] 
Sent: Thursday, May 11, 2006 2:53 AM
To: Log4J Users List
Subject: Re: Logger vs. Appender

Curt Arnold wrote:
> 
> On May 8, 2006, at 1:33 AM, David Hosier wrote:
> 
> ...
> 
>>
>> Anyway...thanks again for the reply, looking forward to hearing other 
>> people's thoughts.
>>
> 
> I'd suggest creating a static helper class that generates a message 
> object and then calls logger methods.  The message object's toString 
> () should return a string that would be appropriate when the logging 
> request is handled by stock appenders like ConsoleAppender and 
> FileAppender, however your custom appender can get the message object 
> and get at the parts.

This approach certainly works; we've been using it for 2 years...

   BugBear

---------------------------------------------------------------------
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


Mime
View raw message