I am trying to use log4j2 with Spring Boot (2.0.3).
I have added below dependency in my pom file and excluded spring-boot-starter-logging as well:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
The problem is when I deploy my war on tomcat, and put the config file with name log4j2.xml on class path(WEB-INF/classes) logs are getting generated. But If I am trying to use a different file name by putting below property in application.properties, it is not working.
logging.config=classpath:mylog4j2.xml
I have put mylog4j2 in the same folder (WEB-INF/classes) as log4j2, but still logs are not getting generated.
Also I am not allowed to set config path using command line arguments and have to use property file only.
Can anyone please help me out.