Problems with org.apache.log4j.PatternLayout format specifiers?

Discussion in 'Java' started by Pep, Oct 11, 2005.

  1. Pep

    Pep Guest

    Or my understanding of the specifications?

    I have this specification in my configuration file

    log4j.appender.A1.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss z}: %-5p
    [%t] %8x - %m%n

    But the messages in the log file do not contain the name of the tread as I
    believe that %t is supposed to do. Instead they contain the name of the
    class contained in the thread.

    I have checked this by including the name of the thread, using getName(), in
    the message and sure enough the %t formatter is only printing the name of
    the class not the name of the thread :(

    Is %t supposed to show the name of the class, in which case it is my
    misunderstanding of the documentation or should it show the name of the
    thread in which case there is a problem?

    Pep, Oct 11, 2005
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page