The output of the self written object renderer is a string. This will be 
handled by the pattern like you would have put a string directly, means the %m 
switch will be replaced by your string.

Heri

> -----Original Message-----
> From: Anant K [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 19, 2006 2:35 AM
> To: Log4J Users List
> Subject: ObjectRenderer Config and Usage
> 
> 
> Hi,
> 
> I'd like to be able to output an object to the log as part of the
> layout automatically. For example, say I have a class called myObject.
> From my understanding, I first have to implement the ObjectRenderer
> interface to handle myObject. Is it possible to specify an object as
> part of a layout? For example:
> 
> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x
> [MYOBJECTHERE]- %m%n
> 
> where MYOBJECTHERE is the result of calling doRender() on an object of
> type myObject. Is such a thing possible? Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to