Hi,
My is application is something like this

I have some components as the part of it and all the components works in a
single process but may be different threads.

And I want all the components to log to a single file.
So  in the single file I shuld get a component name as well  so that i can
easily find the source one level above class / or file

If i put some thing into MDC or NDC, Will it help me?

Bcoz I found MDC/NDC is for a thread and one thread may load different
components

-George S


On 11/29/05, Bender Heri <[EMAIL PROTECTED]> wrote:
>
> The specifier t within the layout pattern renders the thread name to the
> output.
> I dont know how to output the thread ID.
>
> what do you mean by "some other information"? You can put some values into
> the MDC before calling a logging function. Within the layout you can render
> this values again:
>
>        MDC.put( "SomeInformation", aInfo );
>        try
>        {
>            logger.info( "some message" );
>        }
>        finally
>        {
>            MDC.remove( "SomeInformation" );
>        }
>
>
> The pattern part "%-10X{SomeInformation}" would render the content of
> aInfo, expanded or cutted to 10 characters.
>
> Heri
>
>
>
> > -----Original Message-----
> > From: George Sebastian [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, November 29, 2005 11:52 AM
> > To: [email protected]
> > Subject: Logging Event
> >
> >
> > Hi ,
> > In my application i need to get some more information in the
> > LoggingEvent
> > for e.g thread id along with thread name
> > and some other information as well.
> >
> > Do I need to extend log4j for this and create new Event to be passed?
> >
> > Please help
> >  -George S
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to