Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where is log4j logging parameter set?

 
Mark Stein
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic