From your question, it appears that you are actually not interested in the thread ID but the thread name.

Ayman Hammoudeh wrote:
Yeah thx for the replay that helped me, but I have another question that how 
can I get the stack trace of an exception if I override the dolayout method and 
here it is:




package com.logging;
import java.sql.Timestamp;

import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.LayoutBase;
public class LayoutTest extends LayoutBase<ILoggingEvent> {
        public String doLayout(ILoggingEvent event) {

                StringBuffer sbuf = new StringBuffer(128);
                long time = event.getTimeStamp() ;

                sbuf.append(event.getTimeStamp() - 
event.getLoggerContextVO().getBirthTime());
                sbuf.append(" ");
                sbuf.append(event.getLevel());
                sbuf.append(" [");
                sbuf.append(event.getThreadName());
                sbuf.append("] ");
                sbuf.append(event.getLoggerName());
                sbuf.append(" - ");
                sbuf.append(event.getCallerData());

                sbuf.append(CoreConstants.LINE_SEPARATOR);



                return sbuf.toString();
                }
        }

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Joern Huxhorn
Sent: Wednesday, October 07, 2009 10:41 AM
To: logback users list
Subject: Re: [logback-user] Feature question

I think he would like to output thread.getId().
We discussed about this topic here: 
http://www.qos.ch/pipermail/logback-dev/2009-March/003903.html

Logback isn't able to print the thread-id, at the moment.

Joern.

On 06.10.2009, at 15:54, Ceki Gulcu wrote:


Ayman Hammoudeh wrote:
Hello,
Is there  a way to get the thread-ID in the layout pattern in xml
configuration.
Sorry but your question does not make sense or at least I fail to
understand it. Anyway, have you looked at the %t or %thread conversion
word described at

 http://logback.qos.ch/manual/layouts.html#conversionWord ?


--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework
for Java.
http://logback.qos.ch
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user

_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user

_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user

--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user

Reply via email to