Skip to content

Regression: ${...} property substitution no longer works for scan attribute in Logback 1.5.27+ (works in 1.5.21)Β #1065

Closed

Description

@vaibhavjain2

Hello,

While investigating a logging configuration reload issue in our application, I isolated the problem to a change in Logback behavior that appears to have been introduced after Logback 1.5.21.

We reproduced the issue in a standalone Spring Boot application using different Spring Boot and Logback versions. The behavior is consistent and reproducible.

Summary

Prior to Logback 1.5.27, property substitution was performed before evaluating the scan attribute of the <configuration> element. As a result, environment variables and JVM system properties could be used successfully for enabling/disabling Logback scanning.

Starting with newer Logback versions (including 1.5.32), the scan attribute appears to be evaluated before property substitution, causing values such as ${logback.scan.enabled:-true} to be treated as invalid and preventing the scan task from being registered.

As a result:
β€’ Literal values still work (scan="true").
β€’ Variable-backed values do not work (scan="${logback.scan.enabled:-true}").
β€’ scanPeriod is still substituted correctly, but becomes ineffective because scanning was never enabled.

Observed Results

Spring Boot Logback Literal attributes Environment variables JVM properties
3.5.8 1.5.21 Reloads Reloads Reloads
3.5.14 1.5.32 Reloads Does not reload Does not reload

Example Configuration

<configuration
    scan="${logback.scan.enabled:-true}"
    scanPeriod="${logback.scan.interval.seconds:-30} seconds">

    <root level="INFO">
        <appender-ref ref="CONSOLE" />
    </root>

</configuration>

Environment Variable:
export LOGBACK_SCAN_ENABLED=true
or
-Dlogback.scan.enabled=true

Expected Result
The configuration should behave exactly as:
<configuration scan="true" scanPeriod="30 seconds">

and register a ReconfigureOnChangeTask.

Actual Result (Logback 1.5.32)
Scanning is not enabled.

The configuration reload task is never registered and configuration changes are not detected at runtime.

Using a literal value immediately restores the expected behavior:
<configuration scan="true">

Why Spring Boot 3.5.14 Differs?

Spring Boot 3.5.14 manages Logback 1.5.32.

In that Logback version, the scan attribute is converted directly to a Boolean before property substitution. A value such as:
scan="${logback.scan.enabled:-false}"
is therefore reported as unrecognized and scanning is not registered.

scanPeriod is still substituted correctly, but it is never used because scan was not successfully recognized.

Investigation

The behaviour appears to have changed between:
β€’ ConfigurationModelHandlerFull (1.5.21)
and
β€’ ConfigurationModelHandler (1.5.32)

The earlier implementation performs substitution of the scan attribute value before evaluating it.
The newer implementation appears to evaluate the raw attribute value directly.

Suspected Regression

After comparing versions and reviewing the code history, this behavior appears to have been introduced by:
e7764f4

The changelog describes the change as:
"Refactored file scanning code for improved clarity"

However, it does not mention any behavioral change regarding property substitution of the scan attribute.

Reproduction

The issue is reproducible in a minimal standalone Spring Boot application and is not specific to our production application.

Works:
β€’ Spring Boot 3.5.8 / Logback 1.5.21
β€’ scan="${logback.scan.enabled:-true}"
Does Not Work:
β€’ Spring Boot 3.5.14 / Logback 1.5.32
β€’ scan="${logback.scan.enabled:-true}"
Works Again:
β€’ Spring Boot 3.5.14 / Logback 1.5.32
β€’ scan="true"

Questions

  1. Is this behavioral change intentional?
  2. Is property substitution for the scan attribute no longer supported?
  3. If not intentional, could this be considered a regression introduced during the scanning code refactoring?
  4. Would it be possible to restore the previous behavior where the scan attribute is substituted before being evaluated?

Thank you for your time and for maintaining Logback. I'd be happy to provide a small reproducer project if needed.

Environment

β€’ Spring Boot 3.5.8 β†’ Logback 1.5.21
β€’ Spring Boot 3.5.14 β†’ Logback 1.5.32
β€’ Java 21
β€’ Reproduced on a minimal standalone Spring Boot application and on our production application.

Activity

  1. self-assigned this
    on Aug 20, 2026
  2. added theissue type on Aug 20, 2026
  3. added this to the 1.6.4 milestone on Aug 20, 2026
  4. ceki commented on Aug 20, 2026

    @ceki
    Member

    @vaibhavjain2 Thank you for this report. I am investigating the issue. May I ask which AI agent was used to produce this report?

  5. vaibhavjain2 commented on Aug 20, 2026

    @vaibhavjain2
    Author

    Thank you @ceki for a quick response. I used MS365 Copilot to draft the report, however I verified it thoroughly before posting to ensure it conveys what I actually mean. :)

  6. ceki commented on Aug 20, 2026

    @ceki
    Member

    Fixed in 3b36509

  7. vaibhavjain2 commented on Aug 20, 2026

    @vaibhavjain2
    Author

    Thanks a lot. May I know which Logback version will include this commit/fix?

  8. vaibhavjain2 commented on Aug 24, 2026

    @vaibhavjain2
    Author

    @ceki,
    Thanks for the quick turnaround and for fixing this issue.

    I've validated the fix locally by building Logback from source using your commit 3b36509 and confirmed that scan config and property substitution now works correctly for both:

    scan="${logback.scan.enabled:-true}"
    scanPeriod="${logback.scan.interval.seconds:-30} seconds"
    

    One question: do you plan to backport this fix in a 1.5.x release as well, or will it only be available in the 1.6.x line?
    The news page only states that 1.6.x is the active series and 1.5.x is legacy

    The regression was introduced in the 1.5.x series and many Spring Boot applications are currently consuming Logback 1.5.x versions, so understanding the target release version would help us plan a potential upgrade path.

    Thanks again for the investigation and fix.

  9. ceki commented on Aug 24, 2026

    @ceki
    Member

    The section "Latest STABLE version: the 1.6.x series" states:

    The 1.6.x series is a direct descendant of, and a drop-in replacement for, the 1.5.x series, ...

    Given that as of today 1.5.38 is the latest in the 1.5 series and 1.6.3 is the latest in the 1.6 series, if you can upgrade to 1.5.39, then you can also upgrade to 1.6.4. That is the bottom line.

  10. vaibhavjain2 commented on Aug 25, 2026

    @vaibhavjain2
    Author

    Alright, thanks @ceki.
    One last question, I won't bother you more, I promise: When is the tentative release date for v1.6.4? I see there's no due date mentioned on the milestone.

    Knowing this would really help us plan our releases. If you've any idea about it, please let me know.

    Thank you so much for your time and support. I appreciate it. :)

  11. vaibhavjain2 commented on Sep 28, 2026

    @vaibhavjain2
    Author

    Hi @ceki, do you want to close this bug? Looks like it's still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions