Because we want to use a different logging styles for the runtime and the build time, it seems that it is currently not possible to use this configuration:
logging:
config: ${LOGGING_CONFIG_VALUE:classpath:logback.xml}
When you perform a native build without any LOGGING_CONFIG_VALUE environment variable logback.xml from classpath is used, but when you later on add the environment variable LOGGING_CONFIG_VALUE during runtime still logback.xml is used.
The only way to enforce a different logging configuration is to use it during the maven build e.g. clean deploy -Pnative_build -DLOGGING_CONFIG_VALUE=classpath:logback-json.xml for example
Comment From: snicoll
The only way to enforce a different logging configuration is to use it during the maven build
That's what you should be doing. Processing the logback.xml does not work in a native image so you have to specify the one you want at build-time. AOT transforms the XML into something that can be processed by a native image. Please review this page and, in particular this section.
Comment From: klopfdreh
All right! Thank you! 👍