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
One way you can do it is to add it yourself using log4j MDC. We use it for adding the username for web requests. We do this in a filter at the start of each request. Eg.
import org.apache.log4j.MDC;
...
// Add username to MDC
String username = ...;
MDC.put("user", username);
Then add [%X{user}] to your conversion pattern.