I currently have the below pattern layout in log4j. I want to add the Process id to the log file. How can I do it?
log4j.appender.A1.layout=org.apache.log4j.Pa
There is no way of doing it using standard Java classes. Generally process ID is appended at file level not at the log level. And here (archived here) is an example of doing it.