logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OOMS DIRK <Ext.Dirk.O...@siemens.be>
Subject RE: Customizing pattern
Date Thu, 03 Mar 2005 15:48:12 GMT
You can use MDC for this.

In your code:
MDC.put("Key", "blabla");

In the appender PatternLayout:

If you use the LogFilePatternReceiver you can add in the 'format':

When post-processing in Chainsaw you can filter on PROP.Key == blabla

You can order on this property by double-clicking the column in chainsaw.

Hope this helps,

> -----Original Message-----
> From: Jitendra Kharche [mailto:jitendrakh@geometricsoftware.com] 
> Sent: donderdag 3 maart 2005 16:44
> To: Log4J Users List
> Subject: Customizing pattern
> Hi All,
> I am using the pattern "Date Priority [Category] Message\n".
> I want to modify this pattern to add a key as a prefix to each log
> statement e.g. "Key Date Priority [Category] Message\n".
> I want to use this key to group log statements. Log statements having
> same key will be grouped and indicates the audit record of 
> processing of
> a event occured in the system.
> Is this possible? Can someone help me?
> Or there is any other better way of achieving this type of
> functionality?
> Can I configure Chainsaw to group log statements based on this or some
> other criteria.
> Regards,
> Jitendra

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

View raw message