title: How to configure log4j2 to log for HikariCP
body: <p>I have written a small Gradle project so that I can learn how to configure HikariCP and JDBC and Log4j2 all together in the same project. I have placed the below log4j2 config in the <code>src/main/resources</code> directory in my project. When I execute the project using <code>gradle run</code> I get a warning about not configuring an appender for the <code>com.zaxxer.hikari.HikariConfig</code> logger.</p>
  
  <p>Would some one kindly tell me what i am doing wrong?</p>
  
  <p>log4j2.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Configuration status="WARN"&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;/Appenders&gt;
    &lt;Loggers&gt;
      &lt;Logger name="com.zaxxer.hikari.HikariConfig" level="trace"&gt;
        &lt;AppenderRef ref="Console"/&gt;
      &lt;/Logger&gt;
      &lt;Root level="TRACE"&gt;
        &lt;AppenderRef ref="Console"/&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'maven'
  apply plugin: 'application'
  
  targetCompatibility = 1.8
  sourceCompatibility = 1.8
  version = '0.0.1.0'
  group = 'com.s2d'
  
  mainClassName = "com.s2d.jdbctest.DemoJDBC"
  applicationDefaultJvmArgs = ["-Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver"]
  
  task wrapper(type: Wrapper) {
    gradleVersion = '1.4'
  }
  
  repositories {
    mavenCentral()
  }
  
  dependencies {
    compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.0.2'
    compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.0.2'
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.10'
    compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.10'
    compile group: 'com.zaxxer', name: 'HikariCP', version: '2.3.7'
    runtime group: 'org.apache.derby', name: 'derby', version: '10.11.1.1'
    testCompile group: 'junit', name: 'junit', version: '4.11'
  }
  
  test.scanForTestClasses(false)
  
  javadoc.options.links("http://docs.oracle.com/javase/7/docs/api/")
  
  task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
  }
  
  task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
  }
  
  artifacts {
    archives sourcesJar
    archives javadocJar
  }
  </code></pre>
  
  <p>Execution output</p>
  
  <pre><code>[sts] -----------------------------------------------------
  [sts] Starting Gradle build for the following tasks: 
  [sts]      run
  [sts] -----------------------------------------------------
  :compileJava UP-TO-DATE
  :processResources
  :classes
  :run
  20:27:11.247 [main] INFO  com.s2d.jdbctest.DemoJDBC - Starting demo
  log4j:WARN No appenders could be found for logger (com.zaxxer.hikari.HikariConfig).
  log4j:WARN Please initialize the log4j system properly.
  log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  Column Count: 1
  Column 1 name: 1 type: DECIMAL
  Inserted ID: 1005
  20:27:12.350 [main] INFO  com.s2d.jdbctest.DemoJDBC - Demo complete
  
  BUILD SUCCESSFUL
  
  Total time: 2.017 secs
  [sts] -----------------------------------------------------
  [sts] Build finished succesfully!
  [sts] Time taken: 0 min, 2 sec
  [sts] -----------------------------------------------------
  </code></pre>