jettyRun seems to run with java util log system set to DEBUG level

(Mike Gillam) #1

After converting our project to use gradle (which is largely fantastic btw), we noticed that our app start up time through a jettyRun task seemed to be noticable slower. After a bit of debugging we noticed the following code in the class org.gradle.logging.internal.JavaUtilLoggingConfigurer:

public class JavaUtilLoggingConfigurer implements LoggingConfigurer {
    private boolean configured;
      public void configure(LogLevel logLevel) {
        if (configured) {
 // <------ *** INTERESTRING LINE ***
        configured = true;

Seems like this line forces the global logger (and hence all non-explicitly set loggers) to run at DEBUG level.

So, I added the following snippet to my jettyRun task:

doFirst {
    println("Resetting JDK log level to INFO...")

and this seems to fix the issue.

Anyway, is the fix appropriate, or am I missing a more elegant way of controlling log levels during a jetty run?

Thanks in advance for any help… Mike.