Comments (5)
The bug affects 3.3.0-RC1 that uses logback 1.5.6 (see #40401).
Spring boot 3.2.5 uses version 1.4.14 of logback, the issue arises when manually upgrade to logback >= 1.5.5.
from spring-boot.
Hey, thanks for the report. Can you please attach your sample project as something we can clone or unzip? Thanks!
from spring-boot.
from spring-boot.
Thanks for the sample @fupgang.
The Spring Boot documentation states that a file logback-spring.xml
should be used to configure Logback instead of logback.xml
when Spring extensions are used. That doesn't fix the problem, but the correct file name should be used once this issue is resolved.
Spring Boot adds the springProperty
extension rule using the path configuration/springProperty
:
Logback's SimpleRuleStore.matchActions(ElementPath elementPath)
will be called when the springProperty
element is encountered in included.xml
using the provided sample.
When using Logback 1.5.4 and earlier, matchActions
gets a path [configuration][springProperty]
, the lookup succeeds, and the prefix
property is resolved.
When using Logback 1.5.5 and later, matchActions
gets a path [included][springProperty]
, the lookup fails, and the prefix
property is not resolved.
Spring Boot might be able to address this by adding springProperty
with a path like */springProperty
as we do with springProfile
.
@ceki Was this change in lookup paths intended as part of the changes mentioned above in Logback 1.5.5 and 1.5.6?
from spring-boot.
@scottfrederick I think the analysis provided by @fupgang is quite accurate.
The key phrase is:
Since the refactoring a new instance of JoranConfigurator is created when an inclusion is processed.
IncludeModelHandler
(new in logback 1.5.5) reads the included XML file and transforms it to a model using a new configurator instance provided by a supplier set in ModelInterpretationContext
.
The fix suggested by @fupgang seems quite appropriate. Indeed, the default configurator supplier will return an instance of JoranConfigurator
instead of SpringBootJoranConfigurator
. JoranConfigurator
is unaware of <springProperty>
.
As for the matchActions
, IncludeModelHandler adds a mapping replacing "includes" path-part with "configuration" path-part which should be fine as well.
In short, overriding buildModelInterpretationContext
in SpringBootJoranConfigurator
is the way to go.
Perhaps something like:
class SpringBootJoranConfigurator extends JoranConfigurator {
private SpringBootJoranConfigurator makeAnotherSpringBootConfiguratorInstance() {
SpringBootJoranConfigurator sbjc = new SpringBootJoranConfigurator();
sbjc.setContext(this.context);
return sbjc;
}
public void buildModelInterpretationContext() {
super.buildModelInterpretationContext();
this.modelInterpretationContext.setConfiguratorSupplier(() -> {
return this.makeAnotherSpringBootConfiguratorInstance();
});
}
from spring-boot.
Related Issues (20)
- spring-boot-dependencies cannot be used with repositories that ban com.oracle.database.jdbc:ojdbc-bom
- spring-boot-dependencies cannot be used with repositories that ban com.oracle.database.jdbc:ojdbc-bom
- Upgrade to Asciidoctor Gradle Plugin 4.0.2
- Avoid calling getProject() during execution of StarterMetadata task
- Avoid calling getProject() during execution of StarterMetadata task
- Avoid calling getProject() during execution of StarterMetadata task
- Avoid calling getProject() during execution of AutoConfigurationMetadata task
- Avoid calling getProject() during execution of AutoConfigurationMetadata task
- Avoid calling getProject() during execution of AutoConfigurationMetadata task
- Avoid calling getProject() during execution of publishMavenPublicationToProjectRepository
- Avoid calling getProject() during execution of publishMavenPublicationToProjectRepository
- Avoid calling getProject() during execution of publishMavenPublicationToProjectRepository
- Avoid calling getProject() when checking configuration metadata
- Avoid calling getProject() when checking configuration metadata
- Avoid calling getProject() when checking configuration metadata
- IllegalArgumentException can be thrown when running an uber jar on a shared drive HOT 4
- Avoid calling getProject() during execution of extractVersionConstraints
- Avoid calling getProject() during execution of extractVersionConstraints
- Enabling distribution percentiles for Prometheus 1.x leads to "Counts in ClassicHistogramBuckets cannot be negative" HOT 2
- LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.