title: Log4j 2 configuration: XML vs JSON?
body: <p><a href="http://logging.apache.org/log4j/2.x/manual/configuration.html" rel="nofollow">Apache manual</a> simply states: " </p>
  
  <blockquote>
    <p>Configuration of Log4j 2 can be accomplished in 1 of 4 ways:<br>
    Through a configuration file written in XML, JSON, or YAML.<br>
    Programmatically, by creating a ConfigurationFactory and Configuration implementation.<br>
    Programmatically, by calling the APIs exposed in the Configuration interface to add components to the default configuration.<br>
    Programmatically, by calling methods on the internal Logger class.</p>
  </blockquote>
  
  <p><strong>Id' like to hear if there's visible trends in favoring one of these 4 ways?</strong><br>
  Behind this question is the shift of Log4j (version 1) configuration practice from .properties files to XML format. It's pretty frustrating to search for answers for a problem and receive the right answer but not quite with configuration method you are using.</p>
  
  <p>I have a new log4j (version 2) project coming up and I'd like to use JSON as a configuration format against the default XML way of doing it (reason: aesthetics and slight performance advantage(?) ).</p>
  
  <p><strong>Will I encounter problems or not get as many features if I choose the JSON configuration format over XML?</strong> </p>
  
  <p><strong>Any reasons to use programmatic approach instead of a static configuration file?</strong></p>
  
  <p>Use case would be (ideally) that single configuration file is read by the application server (from some file path on the server). This single .json file would then be used to apply log levels per application and produce at least 3 different logs (general, error, custom log level) per application. There's less than 10 applications designed to run on a server. </p>