[logback-dev] [JIRA] Updates for LOGBACK-1674: Nested Appenders within AsyncAppender no longer work

QOS.CH (JIRA) noreply-jira at qos.ch
Wed Sep 7 15:08:00 CEST 2022


logback / LOGBACK-1674 [Open]
Nested Appenders within AsyncAppender no longer work

==============================

Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.

View or comment on issue using this link
https://jira.qos.ch/browse/LOGBACK-1674

==============================
 Issue created
------------------------------

Luke Stephenson created this issue on 07/Sep/22 2:57 PM
Summary:              Nested Appenders within AsyncAppender no longer work
Issue Type:           Bug
Affects Versions:     1.3.0, 1.4.0
Assignee:             Logback dev list
Created:              07/Sep/22 2:57 PM
Priority:             Major
Reporter:             Luke Stephenson
Description:
  Previously in older versions of logback the following was valid:
  
   
  
   
  {code:java}
  <configuration>
      <appender name="STDOUT-ASYNC" class="ch.qos.logback.classic.AsyncAppender">
          <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
              <encoder class="com.foo.SomeEncoder"/>
          </appender>
      </appender>    
      <root level="${ROOT_LOG_LEVEL:-info}">
          <appender-ref ref="STDOUT-ASYNC"/>
      </root>
  </configuration>
  {code}
  With logback 1.3.0 and 1.4.0 this fails with:
  {code:java}
  22:49:33,671 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [STDOUT-ASYNC]
  22:49:33,671 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.classic.AsyncAppender]
  22:49:33,673 |-WARN in ch.qos.logback.core.model.processor.AppenderModelHandler - Appender named [STDOUT] not referenced. Skipping further processing.
  22:49:33,673 |-ERROR in ch.qos.logback.classic.AsyncAppender[STDOUT-ASYNC] - No attached appenders found.
  {code}
  To get it to work, I have to switch to the "appender-ref" style.
  {code:java}
  <configuration>
      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
          <encoder class="com.zendesk.logging.JsonLogEncoder"/>
      </appender>
  
      <appender name="STDOUT-ASYNC" class="ch.qos.logback.classic.AsyncAppender">
          <appender-ref ref="STDOUT" />
      </appender>
  
      <root level="${ROOT_LOG_LEVEL:-info}">
          <appender-ref ref="STDOUT-ASYNC"/>
      </root>
  </configuration>
  {code}
  Not sure if this an intentional change to drop support for the format we used earlier, or a bug.
  
  Thanks
  
   


==============================
 This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)



More information about the logback-dev mailing list