Skip to content

Wrong logging pattern with multiple web applications #24835

@windmueller

Description

@windmueller

After updating Spring Boot from 2.3.5 to 2.4.1, our logging patterns are messed up. Our setup is that we deploy multiple Spring Boot applications onto the same Tomcat. When the first application is deployed, it sets the system property LOG_LEVEL_PATTERN which seems to be evaluated for all applications that are being deployed afterwards.

The log pattern itself is modified by Spring Cloud and looks like

%5p [${spring.zipkin.service.name:${spring.application.name:}},%X{traceId:-},%X{spanId:-}]

When using Spring Boot 2.3.5, spring.application.name could not be resolved during the evaluation of LoggingSystemProperties, but this seems to have changed with 2.4.1.

Is it even possible to disable the system property setting so that there is no conflict between the applications?

Update: I think the difference can be found in org.springframework.boot.logging.logback.LogbackLoggingSystem#loadDefaults. In 2.3.5, LOG_LEVEL_PATTERN was initialized for the logger context in this method. However, in 2.4.1 the context no longer contains this property. It is evaluated in ch.qos.logback.core.subst.NodeToStringTransformer#lookupKey.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: regressionA regression from a previous release

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions