title: Custom appender in logback configuration with Spring extension not working
body: <p>My ultimate goal is to use my custom appender in a Spring boot app. The appender needs to autowired other variable which is not working if I referenced the appender directly in the logback.xml. I found reading about logback extension for spring <a href="https://github.com/qos-ch/logback-extensions/wiki/Spring" rel="nofollow noreferrer">https://github.com/qos-ch/logback-extensions/wiki/Spring</a> . I tried to following the directions, but the custom appender was not instantiated. The log shows that the DelegatingLogbackAppender was indeed created, but I don't know why it is not linked with my appender. </p>
  
  <p>Here is my logback.xml:</p>
  
  <pre><code>&lt;configuration debug="true"&gt;
      &lt;appender name="rabbitmqAppender" class="ch.qos.logback.ext.spring.DelegatingLogbackAppender"/&gt; 
      &lt;root level="INFO"&gt;
          &lt;appender-ref ref="rabbitmqAppender"/&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here is my Spring configuration code (less import lines):</p>
  
  <pre><code>@Configuration
  public class LogbackConfig 
  {
      @Bean 
      public static ApplicationContextHolder applicationContextHolder() {
          return new ApplicationContextHolder ();
      }
  
      @Bean 
      public static LoggerContext loggerContext() {
          return (LoggerContext) LoggerFactory.getILoggerFactory();
      }
  
      @Bean (initMethod = "start", destroyMethod = "stop")
      public static PatternLayoutEncoder encoder (LoggerContext ctx) {
          PatternLayoutEncoder encoder = new PatternLayoutEncoder();
          encoder.setContext(ctx);
          encoder.setPattern("%date %-5level [%thread] %logger{36} %m%n");
          return encoder;
      }
  
      @Bean (initMethod = "start", destroyMethod = "stop")
      public static RabbitMQAppender rabbitmqAppender(LoggerContext ctx, PatternLayoutEncoder encoder) {
          RabbitMQAppender appender = new RabbitMQAppender();
          appender.setContext(ctx);
          return appender;
      }
  }
  </code></pre>
  
  <p>I also tried to use the ConsoleAppender shown in the doc example. It didn't show any log lines in the console either.</p>