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
You can use the ThreadContext Map to supply meta-data to log4j2. This is a String Map of values that you CAN add through normal formatting.
String threadId = String.valueOf(Thread.currentThread().getId());
ThreadContext.put("TId", threadId);
And a much more reasonable Pattern:
Full Log4j2 documentation on "Fish Tagging"