• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Log4j - Could not get Thread number in log

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I would be thankful if someone could tell How could I retrive the thread number in log file. How to configure log4j ? what pattern should be given for getting thread number ?

I have a sample configuration which gave the following log message in logs on different servers.

In Tomcat :

2003-10-19 20:38:34 HttpProcessor[8080][0] Starting background thread

In weblogic :

Jul 19 08:44:00 DEBUG [ExecuteThread-42]

In Sun One :

Aug 01 17:48:52 DEBUG [service-j2ee] ( I need to retrive thread number in SunOne ).

Thanks & Regards
Vishnu

SCJP, SCWCD
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you getting the output you displayed? Is it log4j output? If so, is the thread info from %t?

The PatternLayout API documentation says that %t in the conversion pattern results in printing the name of the thread.

If that is where your output is from it sounds like the "name" of the thread varies depending upon the server.
 
vishnu deevi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carol

In the above log samples I have mentioned only for Sun One Its not giving the thread number. Will %t gives only the thread name ? How to retrive thread number also along with it.

Thanks for your help.

Regards
Vishnu
 
reply
    Bookmark Topic Watch Topic
  • New Topic