title: How to use JSON appender in Logback?
body: <p>I am trying to output all my log events in JSON format.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
  &lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"&gt;
      &lt;encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"&gt;
          &lt;pattern&gt;%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ} [%thread] %-5level %logger{36} - %msg%n&lt;/pattern&gt;
      &lt;/encoder&gt;
  &lt;/appender&gt;
  &lt;root level="INFO"&gt;
      &lt;!--&lt;appender-ref ref="kafkaAppender" /&gt;--&gt;
      &lt;appender-ref ref="STDOUT" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p></p>
  
  <p>Maven Dependency:</p>
  
  <pre><code>   &lt;dependency&gt;
          &lt;groupId&gt;net.logstash.logback&lt;/groupId&gt;
          &lt;artifactId&gt;logstash-logback-encoder&lt;/artifactId&gt;
          &lt;version&gt;4.7&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I see an error while running this configuration. Did i miss anything?</p>
  
  <p>here is the stacktrace:</p>
  
  <pre><code>Exception in thread "main" java.lang.AbstractMethodError: net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder.headerBytes()[B
  at ch.qos.logback.core.OutputStreamAppender.encoderInit(OutputStreamAppender.java:180)
  at ch.qos.logback.core.OutputStreamAppender.setOutputStream(OutputStreamAppender.java:171)
  at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:81)
  at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
  at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
  at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
  at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
  at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
  at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
  at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
  at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
  at org.slf4j.impl.StaticLoggerBinder.&lt;clinit&gt;(StaticLoggerBinder.java:55)
  at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
  at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
  at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
  at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
  at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
  at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273)
  </code></pre>