This repository was archived by the owner on Feb 23, 2023. It is now read-only.
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
Add support for logback.xml configuration file #625
Not planned
Description
$ ./gradlew bootBuildImage
...
[creator] javax.xml.parsers.FactoryFinder was unintentionally initialized at build time. org.slf4j.impl.StaticLoggerBinder caused initialization of this class with the following trace:
[creator] at javax.xml.parsers.FactoryFinder.<clinit>(FactoryFinder.java:46)
[creator] at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:147)
[creator] at ch.qos.logback.core.joran.event.SaxEventRecorder.buildSaxParser(SaxEventRecorder.java:79)
[creator] at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:57)
[creator] at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:151)
[creator] at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
[creator] at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
[creator] at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
[creator] at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
[creator] at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
[creator] at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
yschimke commentedon Mar 17, 2021
I'm testing now without this but I believe the codepath is when it hit src/main/resources/logback.xml
sdeleuze commentedon Mar 17, 2021
Not an easy one:
We do our best to limit build time initialization but with SLF4J that's hard to avoid and here SLF4J build time init trigger logback
SaxEventRecorder
which performsjavax.xml.parsers.FactoryFinder
static init at build time.Trying to intialize
javax.xml.parsers.FactoryFinder
at build time requires to configure a lot of other classes initialized at build time too so that seems a dead end to me.Any thoughts @aclement?
yschimke commentedon Mar 17, 2021
It worked for me just by deleting the file (I got further), so I'm not blocked.
sdeleuze commentedon Mar 17, 2021
I move this issue to 0.10 since solving that will require deeper changes.
cipley commentedon Mar 19, 2021
Hi,
I stumble upon this issue as well, and want to add some points;
It seems like having the logback file
logback-spring.xml
will result in below error:Which is quite odd since the logback file is actually have the correct extensions.
While in my case, when using
logback.xml
logback file, it will result in build error (I'm using maven btw);and yes, deleting the logback file causes the issue to disappear.
[-]logback config file seems to fail the build[/-][+]Add support for logback.xml configuration file[/+]sdeleuze commentedon Mar 19, 2021
This temporary limitation is now documented.
When we fix that, let's make sure
<springProperty />
is supported as described in #607.42 remaining items