File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Java Products and Servers and the fly likes where is log4j logging parameter set? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "where is log4j logging parameter set?" Watch "where is log4j logging parameter set?" New topic
Author

where is log4j logging parameter set?

Mark Stein
Ranch Hand

Joined: May 20, 2002
Posts: 75
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
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

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

Joined: May 20, 2002
Posts: 75
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
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

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

Joined: May 20, 2002
Posts: 75
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
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: where is log4j logging parameter set?