Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic