I have a Struts application with log4j to display information about application.
The pattern to format log\'s output is as follows:
log4j.appender.RA
I think it is not possible to show thread id with standard log4j formatting. I also investigated through code of PatterParser
class an found nothing which can be useful. I found some custom solutions, but only for IBM server which has %i
option:
%i: Inserts the thread ID. Unlike the thread name (indicated by %t), this is thread's numeric ID. Note that this parameter is particular to Initiate, while the other parameters listed here are standard with log4j.
See this link