Or you could try something like the following to set the thread name

        MyThread myThread = new MyThread();
        myThread.setName("MyPrefix-" + myThread.getId());
        myThread.start();

Regards
Tim A

-----Original Message-----
From: Bender Heri [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 29 November 2005 11:24 PM
To: Log4J Users List
Subject: RE: Logging Event


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]


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

Reply via email to