Closed javapapo closed 2 months ago
When spring.aot is enabled - logback is not loaded at all.
Do you mean that the Logback configuration is not loaded from -Dlogging.config=classpath:logback-xx.xml
? If so, then this is the expected behavior.
Logback is supported, including XML configuration. XML configuration is loaded at build time during AOT processing and translated into a fixed, native-friendly format. As a result, loading different XML configuration at runtime is not supported.
If overriding the default Logback config at runtime with AOT isn't the problem you are trying to describe, then please provide a complete example that demonstrates the problem that we can run ourselves and we can re-open the issue.
Thanks , most probably missed that - the reason I am using the logging.config property is because I want to have a different logback config per Spring profile (dev, prod).
So what is the recommended way to do it? Have a single logback-spring.xml with profiles inside?
@scottfrederick
-SpringBoot 3.3.1 , Java 21, AWS correto. SpringBoot microservice, jar packaging.
-Spring AOT compilation enabled
-Dlogging.config=classpath:logback-xx.xml
java -Dlogging.config=classpath:logback-xx.xml -Dspring.aot.enabled=true -jar ./target/demo-service.jar
When spring.aot is enabled - logback is not loaded at all. When you dont enable aot then logback is picked