As mentioned in spring-boot/issues/33758, as of logback version 1.4.9 (unreleased as of yet) it is possible to load a model configuration file without ever loading JoranConfigurator and without including java.xml in a native image. Configuration files written in XML can be converted to Serialized Model (SMO) format by adding the <serializeModel> directive in logback.xml. This conversion is done by JoranConfigurator. If the resulting SMO file is packaged within the application artifact, e.g. if placed under src/main/resources at build time, during application initialization, the SMO file will be picked up by SerializedModelConfigurator which will configure logback via the serialized model file. I have tested this in GraalVM. |