aspose file tools*
The moose likes Other Open Source Projects and the fly likes Log4j - Could not get Thread number in log Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4j - Could not get Thread number in log" Watch "Log4j - Could not get Thread number in log" New topic
Author

Log4j - Could not get Thread number in log

vishnu deevi
Greenhorn

Joined: Aug 02, 2005
Posts: 2
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

Joined: Oct 10, 2000
Posts: 1364
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

Joined: Aug 02, 2005
Posts: 2
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log4j - Could not get Thread number in log