• 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

where is log4j logging parameter set?

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using an application that logs via log4j. I have multiple instances of the app running on different solaris boxes (each box running sun app server 8.2). All apps use the same log4j.properties file. My problem is I'm receiving different data in the logs.

More specificially, the %t variable, which should give me the thread id. On one box, I get "[service-j2ee]", while on another one I get "[service-j2ee-3]" (or some other thread number).

I need the box that isn't writing the thread number to write the thread number in the log. Otherwise, I can't debug by tracing things through the logs if multiple users are testing.

Does anyone have any idea where that value is set?

Thanks.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I understand that right, you aren't complaining that you don't get the name of the thread, you're complaining that you don't like the thread names that you are getting in the logs. At least that would be the case if your pattern included the string "[%t]".

So it really sounds to me like your question is "How do I control the names of the threads which Sun App Server creates?" Does that sound right? Or is your pattern something more complicated which is truncating the thread names?
 
Mark Stein
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paul, it's not that I don't like the thread name... but on one server I get the threadname-threadID, and on the other I get just the threadName. I need to figure out where I turn on threadID.

Both are using the same log4j.properties with [%t] in the pattern.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay. So your question is about that Sun server then. That isn't an open source project, as far as I know, so let's try moving this post to a more relevant forum. I'm guessing "Other Java Products and Servers"...
 
Mark Stein
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. I wasn't sure if that [%t] was set at a server level, or some place else... My thinking was someone familar with log4j might know where it came from. But anyplace you think I can get an answer.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like I said (and l did hunt down the documentation to confirm I wasn't guessing), it's the thread name. The logging code has no control over those names, it just reports what it is given, that's why I don't think this is a question about log4j.
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic