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

Commit d7c785d

Browse files
committed
Refine logback.xml error message
Closes gh-877
1 parent 036a1f3 commit d7c785d

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

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

+4-11
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.springframework.nativex.substitutions.OnlyIfPresent;
3434
import org.springframework.nativex.substitutions.RemoveXmlSupport;
3535

36-
@TargetClass(className = "ch.qos.logback.classic.util.ContextInitializer", onlyWith = { OnlyIfPresent.class, LogbackIsAround.class, RemoveXmlSupport.class })
36+
@TargetClass(className = "ch.qos.logback.classic.util.ContextInitializer", onlyWith = { OnlyIfPresent.class, LogbackIsAround.class })
3737
final class Target_ContextInitializer {
3838

3939
@Alias
@@ -46,16 +46,9 @@ public void configureByResource(URL url) throws JoranException {
4646
}
4747
final String urlString = url.toString();
4848
if (urlString.endsWith("groovy")) {
49-
if (EnvUtil.isGroovyAvailable()) {
50-
// avoid directly referring to GafferConfigurator so as to avoid
51-
// loading groovy.lang.GroovyObject . See also http://jira.qos.ch/browse/LBCLASSIC-214
52-
GafferUtil.runGafferConfiguratorOn(loggerContext, this, url);
53-
} else {
54-
StatusManager sm = loggerContext.getStatusManager();
55-
sm.add(new ErrorStatus("Groovy classes are not available on the class path. ABORTING INITIALIZATION.", loggerContext));
56-
}
57-
} else {
58-
throw new LogbackException("Unexpected filename extension of file [" + url.toString() + "]. Should be either .groovy or .xml");
49+
throw new LogbackException("Logback Groovy configuration is not supported on native");
50+
} else if (urlString.endsWith("xml")) {
51+
throw new LogbackException("Logback XML configuration is not supported yet, see https://github.com/spring-projects-experimental/spring-native/issues/625");
5952
}
6053
}
6154
}

0 commit comments

Comments
 (0)