You can use MDC for this.
In your code:
MDC.put("Key", "blabla");
In the appender PatternLayout:
%X{Key)
If you use the LogFilePatternReceiver you can add in the 'format':
PROP(Key)
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,
dirk
> -----Original Message-----
> From: Jitendra Kharche [mailto:[EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]