Configuring Log4j2.properties with Spring Boot

Is it possible in Spring Boot 1.5.2 to use log4j2 property configuration as opposed to xml?

The logging documentation in the official Spring docs seems to only point to xml support.

https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html

+3


source to share


1 answer


Yes, you can. In my case, I was unable to get Spring Boot to find mine log4j2.properties

. I needed to specify inside application.properties

:

logging.config=src/main/resources/log4j2.properties

      



While I didn't have to do this if I had log4j2.xml

in the same folder

+1


source







All Articles