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

Commit 9bd23a0

Browse files
committed
Remove programmatic Logback configuration documentation
Closes gh-1533
1 parent 2c9344b commit 9bd23a0

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ implementation("org.springframework.boot:spring-boot-starter-actuator") {
151151
*** Configuration with embedded `logback.xml` https://github.com/spring-projects-experimental/spring-native/issues/625[is not supported yet].
152152
*** 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.
154-
*** See <<logback-workaround, this workaround>> to configure it programmatically.
155154
** Log4j2 is not supported yet, see https://github.com/spring-projects-experimental/spring-native/issues/115[#115].
156155
* `spring-boot-starter-mail`
157156
* `spring-boot-starter-oauth2-resource-server`: WebMvc and WebFlux are supported.

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

-41
Original file line numberDiff line numberDiff line change
@@ -75,47 +75,6 @@ You should add resource configuration using <<native-hints>>.
7575
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:
7676
please use `mvn package spring-boot:run`.
7777

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:
82-
83-
[source,subs="attributes,verbatim"]
84-
----
85-
org.springframework.boot.logging.logback.CustomConfigurator
86-
----
87-
88-
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:
113-
114-
[source,java,subs="attributes,verbatim"]
115-
----
116-
@InitializationHint(types = ColorConverter.class, initTime = InitializationTime.BUILD)
117-
----
118-
11978
==== Missing configuration
12079

12180
The Spring AOT plugin will do the best it can to catch everything but it doesn't understand every bit of code out there.

0 commit comments

Comments
 (0)