Ashok Koyi
Ashok Koyi

Reputation: 5417

How does spring boot resolve PID thru ???? using log4j2

In spring boot's default log4j2.xml, PID is mentioned as ????. I am not sure how log4j2 resolves this to actual PID

Does anyone have any idea how Spring boot makes log4j2 map this special code ???? to actual process id (PID)?

You can find the complete log4j2-file.xml at the below link

https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2-file.xml#L4

Upvotes: 0

Views: 1072

Answers (1)

Andy Wilkinson
Andy Wilkinson

Reputation: 116281

Spring Boot sets a system property named PID when the application is starting up. The value of the PID system property is used by Log4j2 and replaces the ???? in the configuration file.

Upvotes: 3

Related Questions