Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Log4j how to get the value of PID and display it to my file appender

Hello,

 

The code "%pid" does not work it outputs "ERRORid". What shall I use to get the value of PID of my job? Example: NScQO5

 

0683p000009M4ky.png

Labels (3)
3 Replies
Anonymous
Not applicable
Author

Hello,

Are you referring to process ids (PIDs) from Talend jobs for main and independent processes? If so, please use below statement,this will print your PID and hostname.
System.out.println(java.lang.management.ManagementFactory.getRuntimeMXBean().getName());
The tstatcatcher will capture pid, father_pid and root_pid 

Let us know if it is what you are looking for.

Best regards

Sabrina

Anonymous
Not applicable
Author

What I want is to possibly write a code inside the log4j xml so the file that the log4j produces will also contain the job's process id.

 

 

Thank you