title: java logging with log4j and log4j.yaml
body: <p>Looks like java developers are avoiding logging with log4j.yaml they prefer to use log4j.xml instead</p>
  
  <p>I know that there is a support for this in log4j v2 but do not understand why on internet there are no detailed documentation related to this ?</p>
  
  <p>I found a lot documentation python/ruby logging and yaml. I know that java is old language but not understand why java developers are not interested in new things.</p>
  
  <p>Update:</p>
  
  <p>found out how to do, It was hard ;)</p>
  
  <p>log4j2.yml or log4j2-test.yml  </p>
  
  <pre><code># why yaml http://jessenoller.com/blog/2009/04/13/yaml-aint-markup-language-completely-different
  
  status: WARN
  monitorInterval: 900 # 15 min = 900 sec
  
  properties:
      property:
          -
              name: pattern_layout_console
              value: "%d - [%t] %-5p - %c - %M(%L) | %m%n"
  
          -
              name: pattern_layout_console_no_threads
              value: "%d - %-5p - %c - %M(%L) | %m%n"
  
          -
              name: log_path
              value: "./logs"
  
  appenders:
      console:
          -
              name: CONSOLE
              PatternLayout:
              pattern: "${pattern_layout_console_no_threads}"
  
      file:
          -
              name: DEBUG_FILE
              fileName: ${log_path}/debug.log
              PatternLayout:
                  pattern: "${pattern_layout_console}"
               append: false
  
          -
              name: INFO_FILE
              fileName: ${log_path}/info.log
              PatternLayout:
                  pattern: "${pattern_layout_console_no_threads}"
              append: false
  
  ######## .....    
  
  loggers:
      logger:
          -   
              name: ch.company.module
              additivity: false
              appenderRef:
                  -
                      ref: DEBUG_FILE
                      level: DEBUG
                  -
                      ref: INFO_FILE
                      level: INFO
                  -
                      ref: WARN_FILE
                      level: WARN
                  -
                      ref: ERROR_FILE
                      level: ERROR
      root:
          level: INFO
          appenderRef:
                ref: CONSOLE
  </code></pre>
  
  <p>pom.xml</p>
  
  <pre><code>....
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
          &lt;version&gt;2.4.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
          &lt;version&gt;2.4.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
          &lt;version&gt;2.4.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.dataformat&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-dataformat-yaml&lt;/artifactId&gt;
          &lt;version&gt;2.4.3&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-slf4j-impl&lt;/artifactId&gt;
          &lt;version&gt;2.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
          &lt;version&gt;2.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
          &lt;version&gt;2.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-1.2-api&lt;/artifactId&gt;
          &lt;version&gt;2.1&lt;/version&gt;
      &lt;/dependency&gt;
      ... 
  </code></pre>