In my application.yml I got:
logging:
config: classpath:log4j2.debug.yml
And some others in different profiles. When I start the Applica
I used xml files to configure log4j2. What worked for me was adding a @Component with a @PostConstruct method where I reconfigured the logging:
LoggerContext context = (LoggerContext)LogManager.getContext(false);
context.setConfigLocation(URI.create("path to file"));
context.reconfigure();
where the path to the file is something like classpath:log4j2-(insert spring profile here).xml. To do this, I had to exclude spring-boot-starter-logging and include instead spring-boot-starter-log4j2. I spent a long time trying to get this log4j2 configuration to work so maybe this will help someone else.