title: Using Spring from a custom logback appender?
body: <p>We use Spring to obtain all of our JDBC connections as well as part of our persistence framework. However in order to write our own custom DB appender (it has to be a custom since we are not allowed to use the default DBAppender due to table name standards). How can I obtain reference to spring beans/use autowire at this point from inside the Custom Appender? I would prefer staying within spring instead of using plain JDBC.</p>
  
  <p>Custom Appender:</p>
  
  <pre><code>import ch.qos.logback.classic.spi.ILoggingEvent;
  import ch.qos.logback.core.AppenderBase;
  
  public class CustomDBAppender extends AppenderBase&lt;ILoggingEvent&gt; {
  
      protected void append(ILoggingEvent event) {
  
      }
  
  }
  </code></pre>