logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hein Meling <mel...@item.ntnu.no>
Subject Re: renderes in context
Date Sat, 03 Aug 2002 11:08:23 GMT
Maybe I don't understand your question, but wouldn't this do what you
want:

 log.info("Context information... data:" + renderableObject);

???

Cheers,
  Hein

On Fri, 2002-08-02 at 14:39, Barry Kaplan wrote:
> We've just started to use renderers, as it makes things a bit cleaner. 
> However, we often need to log the same object (eg, the state of a newly 
> creatred entity) in several different contexts. What I'm looking for is 
> something functionaly simular to:
> 
> Logger.info(Object object)
> Logger.info(String messagePrefix, Object object)
> Logger.info(Object object, Throwable)
> Logger.info(String messagePrefix, Object object, Throwable)
> 
> Where the renderer is used for 'object', but the log message it produces 
> is preceeded by 'mesagePrefix'.
> 
> I could [almost] achive what I need with:
> 
> log.info("Context information... data:");
> log.info(renderableObject);
> 
> But that creates two log statements, and I only want one (especially 
> since we have many threads and processes pumping messages into the log file.
> 
> -bk
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message