title: Gradle Logging Output Levels
body: <p>In my project classes I've used <code>java.util.logging.Logger</code> and added various log output's throughout my code, using various log  levels ie.</p>
  
  <p><strong>src/main/java/Run.java</strong></p>
  
  <pre><code>import java.util.logging.Level;
  import java.util.logging.Logger;
  
  public class Run{
  
  
      public static void main( String args[] ){
        System.out.println("Hello World");
  
        logger.log(Level.CONFIG, "Just some config info");
        Logger logger = Logger.getLogger(Run.class.getName());
        logger.log(Level.INFO, "Just logging some info");
        logger.log(Level.FINE, "Fine logging");
        logger.log(Level.FINER, "Finer logging");
        logger.log(Level.WARNING, "This is a warning log!");
  
      }
  }
  </code></pre>
  
  <p>Currently when I run <code>gradle -i test</code> all log messages with the <code>Level.INFO</code> defined are shown but none of the config, warn or fine messages are output.</p>
  
  <p>I've tried updating my <strong>build.gradle</strong> file such that:</p>
  
  <pre><code>apply plugin: 'java'
  apply plugin:'application'
  mainClassName = "Run"
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      testCompile "junit:junit:4.11"
  }
  
  run{
      systemProperties = ['java.util.logging.config.file' : 'logging.properties']
  }
  </code></pre>
  
  <p>I've included:</p>
  
  <pre><code>systemProperties = ['java.util.logging.config.file' : 'logging.properties']
  </code></pre>
  
  <p>Then created <strong>/src/main/resource/logging.propertiess</strong></p>
  
  <pre><code>handlers= java.util.logging.ConsoleHandler
  .level= CONFIG
  java.util.logging.ConsoleHandler.level = FINER
  java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
  </code></pre>
  
  <p>Running:</p>
  
  <pre><code>gradle run
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>:compileJava UP-TO-DATE
  :processResources UP-TO-DATE
  :classes UP-TO-DATE
  :run
  Hello World
  
  BUILD SUCCESSFUL
  </code></pre>
  
  <p>And when running <em>gradle -i run</em> I get:
      Successfully started process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java''
      Hello World
      :run (Thread[main,5,main]) completed. Took 0.202 secs.</p>
  
  <pre><code>BUILD SUCCESSFUL
  </code></pre>
  
  <p>ie. no logging information. However commenting out the system.properties from within the run task and re-running <em>gradle -i run</em> I get:</p>
  
  <pre><code>Successfully started process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java''
  Hello World
  Nov 05, 2014 12:07:42 PM Run main
  INFO: Just logging some info
  Nov 05, 2014 12:07:42 PM Run main
  WARNING: This is a warning log!
  :run (Thread[main,5,main]) completed. Took 0.229 secs.
  
  BUILD SUCCESSFUL
  </code></pre>
  
  <p>The info and warning level logs, but not the fine or finer ones. </p>
  
  <p>tldr;</p>
  
  <p>How do I get the config, fine &amp; finer level logs to log to the console in a generic gradle java project ?</p>