Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-575

Logback-classic 1.4.5 emits replayed events at the TRACE level

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.6
    • 2.0.4
    • Unspecified
    • None
    • Gradle 7.4.2 running JUnit 5 tests, using slf4j-api:2.0.5 and logback-classic:1.4.5 (versions confirmed via gradle dependencies).

    Description

      When I run my junit tests (in gradle, using `./gradlew test`), I see this message, followed by thousands of log messages at the `TRACE` level:

      SLF4J: A number (20761) of logging calls during the initialization phase have been intercepted and are
      SLF4J: now being replayed. These are subject to the filtering rules of the underlying logging system.

      However, contrary to what this says, these events do not, in fact, seem to be subject to the filtering rules. I've written a `logback-test.xml` configured as follows, which should be ignoring all `TRACE` events, and this same configuration worked as expected in logback-classic 1.2.11.

      ```
      <configuration>
      <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
      <encoder>
      <pattern>%d %-5level [%thread] %logger{25}: %msg%n</pattern>
      </encoder>
      <immediateFlush>true</immediateFlush>
      </appender>
      <root level="WARN">
      <appender-ref ref="CONSOLE" />
      </root>
      </configuration>
      ```

      The `appender` configuration is getting picked up correctly, which I confirmed by adding a recognizable prefix to the `pattern` tag. Also, the `appender-ref` tag is getting processed correctly, since all logs disappear if I set `ref="NONEXISTENT"`.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            prdoyle Patrick Doyle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: