After the logback 1.5.7 upgrade, a deprecated warning is now shown:
01:56:52,355 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@17f9344b - Adding [jar:file:/Users/Shared/.m2/repository/org/springframework/boot/spring-boot/3.3.3/spring-boot-3.3.3.jar!/org/springframework/boot/logging/logback/defaults.xml] to configuration watch list.
01:56:52,355 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@315ba14a - URL [jar:file:/Users/Shared/.m2/repository/org/springframework/boot/spring-boot/3.3.3/spring-boot-3.3.3.jar!/org/springframework/boot/logging/logback/defaults.xml] is not of type file
01:56:52,357 |-WARN in ch.qos.logback.core.joran.action.ConversionRuleAction - [converterClass] attribute is deprecated and replaced by [class]. See element [conversionRule] near line 8
01:56:52,357 |-WARN in ch.qos.logback.core.joran.action.ConversionRuleAction - [converterClass] attribute is deprecated and replaced by [class]. See element [conversionRule] near line 9
01:56:52,357 |-WARN in ch.qos.logback.core.joran.action.ConversionRuleAction - [converterClass] attribute is deprecated and replaced by [class]. See element [conversionRule] near line 10
01:56:52,357 |-WARN in ch.qos.logback.core.joran.action.ConversionRuleAction - [converterClass] attribute is deprecated and replaced by [class]. See element [conversionRule] near line 11
01:56:52,357 |-WARN in ch.qos.logback.core.joran.action.ConversionRuleAction - [converterClass] attribute is deprecated and replaced by [class]. See element [conversionRule] near line 12
Which are the below lines in: org/springframework/boot/spring-boot/3.3.3/spring-boot-3.3.3.jar!/org/springframework/boot/logging/logback/defaults.xml
<conversionRule conversionWord="applicationName" converterClass="org.springframework.boot.logging.logback.ApplicationNameConverter" />
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="correlationId" converterClass="org.springframework.boot.logging.logback.CorrelationIdConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
Comment From: sgyyz
The 3.3.2 is fine but the 3.3.3 got these outputs.
Comment From: nikooooooooooooooooooo
The logback prompt is obvious because converterClass is abandoned and replaced by class
public static String CONVERTER_CLASS_ATTRIBUTE = "converterClass";
protected boolean validPreconditions(SaxEventInterpretationContext seic, String name, Attributes attributes) {
PreconditionValidator pv = new PreconditionValidator(this, seic, name, attributes);
boolean invalidConverterClassAttribute = pv.isInvalidAttribute(CONVERTER_CLASS_ATTRIBUTE);
boolean invalidClassAttribute = pv.isInvalidAttribute("class");
if (!invalidConverterClassAttribute) {
String var10001 = CONVERTER_CLASS_ATTRIBUTE;
pv.addWarn("[" + var10001 + "] attribute is deprecated and replaced by [class]. " + pv.getLocationSuffix());
}
boolean missingClass = invalidClassAttribute && invalidConverterClassAttribute;
if (missingClass) {
pv.addMissingAttributeError("class");
return false;
} else {
boolean multipleClassAttributes = !invalidClassAttribute && !invalidConverterClassAttribute;
if (multipleClassAttributes) {
pv.addWarn("Both [" + CONVERTER_CLASS_ATTRIBUTE + "] attribute and [class] attribute specified. ");
pv.addWarn("[class] attribute will override. ");
}
pv.validateGivenAttribute("conversionWord");
return pv.isValid();
}
}
org/springframework/boot/logging/logback/defaults.xml
<conversionRule conversionWord="clr" class="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex" class="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx" class="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
can define the conversionRule yourself, instead of using the default defaults.xml
Comment From: snicoll
Thanks for the report.
See #41887, this can be reproduced by adding <include resource="org/springframework/boot/logging/logback/defaults.xml" /> - default setup isn't affected.
Comment From: knoobie
I've also seen a lot of noise while starting an application now.. also related to this or something other / new?
Boot 3.3.3
[INFO] --- spring-boot:3.3.3:run (default-cli) @ project---
[INFO] Attaching agents: []
09:25:56,902 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version 1.5.7
09:25:56,905 |-INFO in ch.qos.logback.classic.util.ContextInitializer@433d61fb - Here is a list of configurators discovered as a service, by rank:
09:25:56,905 |-INFO in ch.qos.logback.classic.util.ContextInitializer@433d61fb - org.springframework.boot.logging.logback.RootLogLevelConfigurator
….. 300 Lines more.. until ASCII art / real application logs starts.
,--. ,--.,--. ,--.,------. ,------.,--. ,---. ,--.
compared to 3.3.2 or below
```log
[INFO] --- spring-boot:3.3.2:run (default-cli) @ project---
[INFO] Attaching agents: []
,--. ,--.,--. ,--.,------. ,------.,--. ,---. ,--.
Comment From: wilkinsona
It's the same problem. The WARN level messages cause all of the status messages to be output, to aid problem diagnosis. You can work around it as @564142183 suggested above, by replacing the include of defaults.xml with your own equivalent configuration.
Comment From: knoobie
Thanks Andy!
Comment From: fride
~I just updated Spring and instead of warnings my app crashes when I include org/springframework/boot/logging/logback/defaults.xml. Are you sure this should be closed?~
Works - just tried it with a demo project from https://start.spring.io/. Sorry for the inconvenience.
Comment From: snicoll
Are you sure this should be closed?
It's impossible to say with the level of details you've provided. If you believe you've found an issue, create a new issue with a small sample application that we can run ourselves.