• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4j - Could not get Thread number in log

 
vishnu deevi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic