logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry Kaplan <bkap...@abwg.com>
Subject renderes in context
Date Fri, 02 Aug 2002 12:39:35 GMT
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>


Mime
View raw message