Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 0e62dcb

Browse files
committed
Refine logback support
This commit restores and refines the LogBack substitution to relax the check on XML files since there is already a check at build time in LogbackHints and @aclement found a related issue. The documentation has been updated to recommend using embedded logback-spring.xml and the logger sample is now mentioned. Closes gh-1505
1 parent 78f1ac4 commit 0e62dcb

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

samples/logger/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
${PWD%/*samples/*}/scripts/compileWithMaven.sh $* && ${PWD%/*samples/*}/scripts/test.sh $* --logging.config=src/main/resources/logback-config.xml
3+
${PWD%/*samples/*}/scripts/compileWithMaven.sh $* && ${PWD%/*samples/*}/scripts/test.sh $*

spring-native-docs/src/main/asciidoc/support.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ implementation("org.springframework.boot:spring-boot-starter-actuator") {
148148
* `spring-boot-starter-jdbc`
149149
* `spring-boot-starter-logging`
150150
** Logback is supported with some limitations
151-
*** Configuration with `logback.xml` embedded in the application https://github.com/spring-projects-experimental/spring-native/issues/625[is not supported yet].
152-
*** Logback XML configuration via `myapp -Dlogging.config=logback-config.xml` or `myapp --logging.config==logback-config.xml` is supported but you need to enable <<spring-aot-configuration, XML support>> and add https://search.maven.org/artifact/org.codehaus.janino/janino[`org.codehaus.janino:janino` dependency].
151+
*** Configuration with embedded `logback.xml` https://github.com/spring-projects-experimental/spring-native/issues/625[is not supported yet].
152+
*** Configuration with embedded `logback-spring.xml`, via `myapp -Dlogging.config=logback-config.xml` or `myapp --logging.config=logback-config.xml` is supported but you need to enable <<aot-build-setup-configuration, XML support>> and add https://search.maven.org/artifact/org.codehaus.janino/janino[`org.codehaus.janino:janino` dependency] (see the `logger` sample).
153153
*** http://logback.qos.ch/manual/configuration.html#conditional[Conditional processing in Logback] configuration with Janino library has limited support. Only simple expressions of `isDefined()` and `isNull()` having string literal as argument are supported.
154154
*** See <<logback-workaround, this workaround>> to configure it programmatically.
155155
** Log4j2 is not supported yet, see https://github.com/spring-projects-experimental/spring-native/issues/115[#115].

spring-native/src/main/java/org/springframework/nativex/substitutions/logback/Target_ContextInitializer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ public void configureByResource(URL url) throws JoranException {
4242
final String urlString = url.toString();
4343
if (urlString.endsWith("groovy")) {
4444
throw new LogbackException("Logback Groovy configuration is not supported on native");
45-
} else if (urlString.endsWith("xml")) {
46-
throw new LogbackException("Logback XML configuration is not supported yet, see https://github.com/spring-projects-experimental/spring-native/issues/625");
4745
}
4846
}
4947
}

0 commit comments

Comments
 (0)