-
Notifications
You must be signed in to change notification settings - Fork 354
Add support for logback.xml configuration file #625
Comments
I'm testing now without this but I believe the codepath is when it hit src/main/resources/logback.xml |
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 Trying to intialize Any thoughts @aclement? |
It worked for me just by deleting the file (I got further), so I'm not blocked. |
I move this issue to 0.10 since solving that will require deeper changes. |
Hi, I stumble upon this issue as well, and want to add some points;
Which is quite odd since the logback file is actually have the correct extensions. While in my case, when using
and yes, deleting the logback file causes the issue to disappear. |
This temporary limitation is now documented. When we fix that, let's make sure |
|
Ran into this one while upgrading to 0.9.x. Did not occur in previous versions. |
I am wondering whether Spring Boot should add more documentation (or features) about Logback's Configurator which allows for programmatic configuration instead of XML configuration. What do you think ? |
Has this task been scheduled in the plan? |
@snicoll @bclozel Any thoughts on @celcius112 comment? |
This should be discussed in: spring-projects/spring-boot#25847 |
This was a blocker for me. I wanted to convert to native but our projects need the logback-spring.xml and springProperty and also the compiler (for if blocks/statements). A way forward might be to implement a new configuration file format but with native 'if' support without using janino compiler? Perhaps a more lean method of setting your appenders (that is somewhat compatible with logback on a basic level). |
same error as @cipley over here with version "0.9.2" |
Having the same issues with my project. So far we've been able to copy a standard logback-spring.xml between our projects. This enables our Splunk HTTP Appender. We're using the follwoing code and other springProperty placeholders:
|
Also fails for me with version
Not advocating for |
@joeyslalom don't hesitate to add a 👍 to the issue spring-projects/spring-boot#25847. If we show that we would like this feature the spring boot team will be more motivated to do it :) |
* And note that there is still an open issue to allow for XML-based configuration, spring-attic/spring-native#625 * Hide Log4j2 support behind a Maven profile
same error as @cipley over here with version "0.10.0" |
* Try to produce a native image * Updated to Spring Boot 2.5.1 and Spring Native 0.10.1-SNAPSHOT * Remove occurences of proxyBeanMethods=false from @configuration and @SpringBootApplication annotations * Need to exclude InventoryReportAggregator fom classpath when producing native image, otherwise fail to disambiguate mainClass. * Revert to default logging provider for Spring Boot apps - Logback * Note that there is still an open issue to allow for XML-based configuration, spring-attic/spring-native#625 * Hide Log4j2 support behind a Maven profile * Remove configuration-processor and context-indexer dependencies * Remove redundant exclusion from sendgrid-java * Update cloudfoundry dependencies to 5.5.0.RELEASE * Set spring-native.version as property * Update documentation * Fix broken links * Upgrade OpenJDK JRE used in Dockerfile to 11.0.11 dates * Add Spring Snapshot repositories * Update Github Actions to produce variant executable artifacts for each of the supported backends (Log4J2 is configured as logging provider in each case) * Fix startup issues by setting spring.sql.init.enabled to false * Update R2dbcConfig so that connectionFactory is correctly initialized for all runtime variants (e.g., local, Docker, and cf push) * manifest.yml updated to pickup artifact from target directory * Be explicit - clean before invoking mvn verify in ci and release yaml (Github Actions) * Make certain final artifacts do not include resources or impl from a prior build variant
Hm, now I'm wondering what is the reproducible case :) What I did is I enabled xml support |
With janino on CP and janino if condition in xml file (as far as I can tell I've added necessary TypeHints) the generated image just exit without any message with exit code 1. Hm, Janino creates class at runtime and loads it. That could be the cause. |
I see now it happens in case |
See #889 for a workaround. |
See also my recent update of Logback support documentation with explain how to specify configuration with |
- While project uses jdk8, you can do native build with jdk11 `./mvnw clean package -Pnative` - You can then run these spring-shell-samples/target/spring-shell-samples java -jar spring-shell-samples/target/spring-shell-samples-3.0.0-SNAPSHOT-exec.jar - Remove logback.xml in favour of spring config to workaround for spring-attic/spring-native#625 - For now remove jcommander command sample to get support for it spring-projects#340 - Relates spring-projects#323
- While project uses jdk8, you can do native build with jdk11 `./mvnw clean package -Pnative` - You can then run these spring-shell-samples/target/spring-shell-samples java -jar spring-shell-samples/target/spring-shell-samples-3.0.0-SNAPSHOT-exec.jar - Remove logback.xml in favour of spring config to workaround for spring-attic/spring-native#625 - For now remove jcommander command sample to get support for it #340 - Relates #323
I created
am I missing something? |
Indeed, I can reproduce. Since embedded |
This will be supported in Spring Boot 3 RC1 to be released tomorrow via spring-projects/spring-boot@4a76fbf thanks to @wilkinsona. |
The text was updated successfully, but these errors were encountered: