You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
*** Configuration with embedded `logback.xml` https://github.com/spring-projects-experimental/spring-native/issues/625[is not supported yet].
152
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).
153
153
*** 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.
154
-
*** See <<logback-workaround, this workaround>> to configure it programmatically.
155
154
** Log4j2 is not supported yet, see https://github.com/spring-projects-experimental/spring-native/issues/115[#115].
156
155
* `spring-boot-starter-mail`
157
156
* `spring-boot-starter-oauth2-resource-server`: WebMvc and WebFlux are supported.
Copy file name to clipboardexpand all lines: spring-native-docs/src/main/asciidoc/troubleshooting.adoc
-41
Original file line number
Diff line number
Diff line change
@@ -75,47 +75,6 @@ You should add resource configuration using <<native-hints>>.
75
75
Because of a temporary limitation of the AOT plugin, developers need to trigger the `package` phase if they wish to run the application with the Spring Boot Maven plugin:
76
76
please use `mvn package spring-boot:run`.
77
77
78
-
[[logback-workaround]]
79
-
==== How can I configure programmatically Logback as a `logback.xml` alternative?
80
-
81
-
As a workaround for https://github.com/spring-projects-experimental/spring-native/issues/625[#625], you can create a `src/main/resources/META-INF/services/ch.qos.logback.classic.spi.Configurator` file with the following content:
Add a `org.springframework.boot.logging.logback.CustomConfigurator` class similar to the one bellow which will disable Spring Boot logging configuration override, reuse Spring Boot defaults, and allow you to customize Logback `LoggerContext`:
89
-
90
-
[source,java,subs="attributes,verbatim"]
91
-
----
92
-
public class CustomConfigurator extends ContextAwareBase implements Configurator {
93
-
94
-
@Override
95
-
public void configure(LoggerContext context) {
96
-
97
-
// Set this to avoid LoggerContext override by Spring Boot
98
-
context.putObject(LoggingSystem.class.getName(), new Object());
99
-
100
-
// Apply Spring Boot default configuration, make sure CustomConfigurator
101
-
// is in the org.springframework.boot.logging.logback package
102
-
LogbackConfigurator configurator = new LogbackConfigurator(context);
103
-
new DefaultLogbackConfiguration(null).apply(configurator);
104
-
context.setPackagingDataEnabled(true);
105
-
106
-
// Your custom configuration goes there
107
-
context.addListener(...);
108
-
}
109
-
}
110
-
----
111
-
112
-
Add also the following hint to your Spring Boot application class:
0 commit comments