You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jen <xw...@yahoo.com> on 2003/06/18 19:58:06 UTC

different message for different level in renderer

Hi,
I would like to render an object according the level,
for example, for debug I just dump the object, for
fatal I need to send out more inforamtion, is that
possible? Thanks

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


Re: different message for different level in renderer

Posted by Avner BenHanoch <av...@kinor.com>.
It is very simple if you are able to do a little bit coding.

the rendering of the Object is invoked from the 'format' method of your
Layout object.  This method accept 'LoggingEvent' argument that contains the
'level'.  If you override this method for your desired Layout you can do
rendering according to 'level'.

See for example format in SimpleLayout.java, there you can see how to
extract the 'level' from the LoggingEvent.

good luck,
 Avner




----- Original Message -----
From: "Jen" <xw...@yahoo.com>
To: <lo...@jakarta.apache.org>
Sent: Wednesday, June 18, 2003 7:58 PM
Subject: different message for different level in renderer


> Hi,
> I would like to render an object according the level,
> for example, for debug I just dump the object, for
> fatal I need to send out more inforamtion, is that
> possible? Thanks
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>


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