title: Why is Log4j2 JsonLayout + KeyValuePair printing empty logEvent messages
body: <p><strong>TL;DR</strong>
  If I'm using JsonLayout with a nested KeyValuePair in my log4j2.xml config the resulting log messages are empty. Any ideas why?</p>
  
  <p><strong>Long Story</strong></p>
  
  <p>I'm using Tomcat 8.5.43 with the following logging related JARs:</p>
  
  <ul>
  <li>jackson-annotations-2.9.7.jar</li>
  <li>jackson-core-2.9.7.jar</li>
  <li>jackson-databind-2.9.7.jar</li>
  <li>slf4j-api-1.7.25.jar</li>
  <li>jcl-over-slf4j-1.7.25.jar</li>
  <li>log4j-api-2.12.0.jar</li>
  <li>log4j-core-2.12.0.jar</li>
  <li>log4j-jul-2.12.0.jar</li>
  <li>log4j-slf4j-impl-2.12.0.jar</li>
  <li>tomcat-extras-juli-8.5.2.jar (as tomcat-juli.jar in /bin)</li>
  <li>tomcat-extras-juli-adapters-8.5.2.jar</li>
  <li>log4j-web-2.12.0.jar (in the webapp)</li>
  </ul>
  
  <p>and the log4j2.xml config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN"&gt;
    &lt;Appenders&gt;
    &lt;Console name="consoleappender" target="SYSTEM_OUT"&gt;
      &lt;JsonLayout compact="true" eventEol="true" stacktraceAsString="true" locationInfo="true"&gt;
        &lt;KeyValuePair key="foo" value="bar"/&gt;
      &lt;/JsonLayout&gt;
    &lt;/Console&gt;
    &lt;Loggers&gt;
      &lt;Root level="info"&gt;
        &lt;AppenderRef ref="consoleappender" /&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>In the setenv.sh I set the classpath to:</p>
  
  <pre><code>CLASSPATH="$JAVA_HOME/lib/tools.jar\
  :$CATALINA_HOME/lib/log4j-api.jar\
  :$CATALINA_HOME/lib/log4j-core.jar\
  :$CATALINA_HOME/lib/log4j-jul.jar\
  :$CATALINA_HOME/lib/jackson-annotations.jar\
  :$CATALINA_HOME/lib/jackson-core.jar\
  :$CATALINA_HOME/lib/jackson-databind.jar"
  </code></pre>
  
  <p>And run Tomcat with the additional JVM args:</p>
  
  <pre><code>-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
  -Dlog4j.configurationFile=file:log4j2.xml"
  </code></pre>
  
  <p>So every Tomcat, JULI, Apache commons and Slf4j logging should be redirected to Log4J2 in the end.</p>
  
  <p>Unfortunately all I see is this: <code>{"logEvent":"","foo":"bar"}</code></p>
  
  <p>Instead of something like this:
  <code>{"thread":"main","level":"INFO","loggerName":"org.apache.catalina.startup.VersionLoggerListener","message":"Server version:        Apache Tomcat/8.5.43","endOfBatch":false,"loggerFqcn":"org.apache.logging.log4j.jul.ApiLogger","threadId":1,"source":{"class":"org.apache.juli.logging.impl.Jdk14Logger","method":"log","file":"Jdk14Logger.java","line":87},"threadPriority":5,"instant":{"epochSecond":1562919500,"nanoOfSecond":701000000}}</code></p>
  
  <p>If I remove the <code>KeyValuePair</code> everything works fine as expected.</p>
  
  <p>What's the issue here?</p>