title: Log4j 2 JSON Configuration
body: <p>I have a configuration in XML that I would like to convert to JSON. The JSON version is not being loaded by Log4j and I cannot find any typos. My test code simply logs an <code>ERROR</code> level and a <code>DEBUG</code> level message. Only <code>ERROR</code> messages are being displayed and no file output is being generated - I'm assuming the framework falls back to the default initialization instead of the JSON file.</p>
  
  <p><em>Note: The log4j2-test.json file is on the classpath.</em></p>
  
  <p>I'm using <strong>apache-log4j-2.0-beta9</strong> binary <a href="http://logging.apache.org/log4j/2.x/download.html" rel="noreferrer">found here</a>.</p>
  
  <p>The XML configuration is the following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration name="Test"&gt;
      &lt;Properties&gt;
          &lt;Property name="Directory"&gt;${sys:user.home}/logs&lt;/Property&gt;
          &lt;Property name="Filename"&gt;test.log&lt;/Property&gt;
      &lt;/Properties&gt;
      &lt;Appenders&gt;
          &lt;Console name="Console" target="SYSTEM_OUT"&gt;
              &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
          &lt;/Console&gt;
          &lt;RollingFile name="File" 
              fileName="${Directory}/${Filename}" 
              filePattern="${Directory}/${date:yyyy-MM}/test-%d{MM-dd-yyyy}-%i.log.gz"&gt;
              &lt;PatternLayout&gt;
                  &lt;pattern&gt;%d %p %logger{36} [%t] %m%n&lt;/pattern&gt;
              &lt;/PatternLayout&gt;
              &lt;Policies&gt;
                  &lt;SizeBasedTriggeringPolicy size="1 MB"/&gt;
              &lt;/Policies&gt;
              &lt;DefaultRolloverStrategy max="10"/&gt;
          &lt;/RollingFile&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
          &lt;Root level="debug"&gt;
              &lt;AppenderRef ref="Console"/&gt;
              &lt;AppenderRef ref="File"/&gt;
          &lt;/Root&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>and the JSON configuration is:</p>
  
  <pre><code>{
     "configuration": {
        "name": "Default",
        "properties": {
           "property": {
              "name":"Directory",
              "value":"${sys:user.home}/logs"
           },
           "property": {
              "name":"FileName",
              "value":"test.log"
           }
        },
        "appenders": {
           "Console": {
              "name":"Console",
              "target":"SYSTEM_OUT",
              "PatternLayout": {
                 "pattern":"%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
              }
           },
           "RollingFile": {
              "name":"File",
              "fileName":"${Directory}/${FileName}",
              "filePattern":"${Directory}/${date:yyyy-MM}/test-%d{MM-dd-yyyy}-%i.log.gz",
              "PatternLayout": {
                 "pattern":"%d %p %logger{36} [%t] %m%n"
              },
              "Policies": {
                 "SizeBasedTriggeringPolicy": {
                    "size":"1 MB"
                 }
              },
              "DefaultRolloverStrategy": {
                 "max":"10"
              }
           }
        },
        "loggers": {
           "root": {
              "level":"debug",
              "appender-ref": {
                 "ref":"Console"
              },
              "appender-ref": {
                "ref":"File"
              }
           }
        }
     }
  }
  </code></pre>