<div dir="ltr">Hi All<div><br></div><div>Versions used:</div><div><br></div><div>Java: 1.8.0_25</div><div><div>logback-core/classic: 1.1.2</div><div>groovy-all: 2.4.1</div><div><br></div><div>I hope somebody can help.  I used the logback.xml -> logback.groovy script to convert my log configuration, which produced:</div><div><br></div><div><pre style="color:rgb(0,0,0);font-family:Menlo"><span style="color:rgb(128,128,128);font-style:italic">//<br></span><span style="color:rgb(128,128,128);font-style:italic">// Built on Thu Mar 05 16:07:54 CET 2015 by logback-translator<br></span><span style="color:rgb(128,128,128);font-style:italic">// For more information on configuration files in Groovy<br></span><span style="color:rgb(128,128,128);font-style:italic">// please see <a href="http://logback.qos.ch/manual/groovy.html">http://logback.qos.ch/manual/groovy.html</a><br></span><span style="color:rgb(128,128,128);font-style:italic"><br></span><span style="color:rgb(128,128,128);font-style:italic">// For assistance related to this tool or configuration files<br></span><span style="color:rgb(128,128,128);font-style:italic">// in general, please contact the logback user mailing list at<br></span><span style="color:rgb(128,128,128);font-style:italic">//    <a href="http://qos.ch/mailman/listinfo/logback-user">http://qos.ch/mailman/listinfo/logback-user</a><br></span><span style="color:rgb(128,128,128);font-style:italic"><br></span><span style="color:rgb(128,128,128);font-style:italic">// For professional support please see<br></span><span style="color:rgb(128,128,128);font-style:italic">//   <a href="http://www.qos.ch/shop/products/professionalSupport">http://www.qos.ch/shop/products/professionalSupport</a><br></span><span style="color:rgb(128,128,128);font-style:italic"><br></span><span style="color:rgb(0,0,67);font-weight:bold">import </span>ch.qos.logback.classic.AsyncAppender<br><span style="color:rgb(0,0,67);font-weight:bold">import </span>ch.qos.logback.classic.encoder.PatternLayoutEncoder<br><span style="color:rgb(0,0,67);font-weight:bold">import </span>ch.qos.logback.core.rolling.RollingFileAppender<br><span style="color:rgb(0,0,67);font-weight:bold">import </span>ch.qos.logback.core.rolling.TimeBasedRollingPolicy<br><span style="color:rgb(0,0,67);font-weight:bold">import </span>ch.qos.logback.core.status.OnConsoleStatusListener<br><br><span style="color:rgb(0,0,67);font-weight:bold">import static </span>ch.qos.logback.classic.Level.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">INFO<br></span><span style="color:rgb(102,14,122);font-weight:bold;font-style:italic"><br></span>statusListener(OnConsoleStatusListener)<br><br>appender(<span style="color:rgb(0,128,0);font-weight:bold">"FILE"</span>, RollingFileAppender) {<br>    file = <span style="color:rgb(0,128,0);font-weight:bold">"target/uwd.log"<br></span><span style="color:rgb(0,128,0);font-weight:bold">    </span>rollingPolicy(TimeBasedRollingPolicy) {<br>        fileNamePattern = <span style="color:rgb(0,128,0);font-weight:bold">"logFile.%d{yyyy-MM-dd}.log"<br></span><span style="color:rgb(0,128,0);font-weight:bold">        </span>maxHistory = <span style="color:rgb(0,0,255)">30<br></span><span style="color:rgb(0,0,255)">    </span>}<br>    encoder(PatternLayoutEncoder) {<br>        pattern = <span style="color:rgb(0,128,0);font-weight:bold">"%date{ISO8601} %-5level %thread [%logger{5}] - %msg%n"<br></span><span style="color:rgb(0,128,0);font-weight:bold">    </span>}<br>}<br>appender(<span style="color:rgb(0,128,0);font-weight:bold">"ASYNC-FILE"</span>, AsyncAppender) {<br>    appender-ref(<span style="color:rgb(0,128,0);font-weight:bold">"FILE"</span>)<br>}<br><br>root(<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">INFO</span>, [<span style="color:rgb(0,128,0);font-weight:bold">"ASYNC-FILE"</span>])</pre></div><div><br></div><div>However, when I run Logback, I get a cryptic NPE. </div><div><br></div><div>What have I done wrong with the config?</div><div><br></div><div>Thanks</div><div><br></div><div>Mik</div><div><br></div><div><b>Stack trace</b></div><div><b>==========</b></div><div><br></div><div><div>/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java</div><div>...</div><div>15:56:00,342 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@2c7b5824 - Added status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener]</div><div>15:56:00,376 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@2c7b5824 - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]</div><div>15:56:00,377 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@2c7b5824 - Naming appender as [FILE]</div><div>15:56:00,468 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - No compression will be used</div><div>15:56:00,471 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern logFile.%d{yyyy-MM-dd}.log for the active file</div><div>15:56:00,476 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'logFile.%d{yyyy-MM-dd}.log'.</div><div>15:56:00,476 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.</div><div>15:56:00,479 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Thu Mar 05 15:55:35 GMT 2015</div><div>15:56:00,510 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: target/uwd.log</div><div>15:56:00,510 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [target/uwd.log]</div><div>15:56:00,519 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@2c7b5824 - About to instantiate appender of type [ch.qos.logback.classic.AsyncAppender]</div><div>15:56:00,519 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@2c7b5824 - Naming appender as [ASYNC-FILE]</div><div>Failed to instantiate [ch.qos.logback.classic.LoggerContext]</div><div>Reported exception:</div><div>java.lang.NullPointerException</div><div><span class="" style="white-space:pre">        </span>at ch.qos.logback.core.AsyncAppenderBase.addAppender(AsyncAppenderBase.java:184)</div><div><span class="" style="white-space:pre">   </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="" style="white-space:pre">     </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div><span class="" style="white-space:pre">   </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span class="" style="white-space:pre">   </span>at java.lang.reflect.Method.invoke(Method.java:483)</div><div><span class="" style="white-space:pre">        </span>at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)</div><div><span class="" style="white-space:pre">        </span>at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)</div><div><span class="" style="white-space:pre">      </span>at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1082)</div><div><span class="" style="white-space:pre"> </span>at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)</div><div><span class="" style="white-space:pre">  </span>at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:836)</div><div><span class="" style="white-space:pre">      </span>at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:827)</div><div><span class="" style="white-space:pre">  </span>at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:164)</div><div><span class="" style="white-space:pre"> </span>at ch.qos.logback.classic.gaffer.PropertyUtil.attach(PropertyUtil.groovy:48)</div><div><span class="" style="white-space:pre">       </span>at ch.qos.logback.classic.gaffer.PropertyUtil$attach.call(Unknown Source)</div><div><span class="" style="white-space:pre">  </span>at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)</div><div><span class="" style="white-space:pre">   </span>at ch.qos.logback.classic.gaffer.PropertyUtil$attach.call(Unknown Source)</div><div><span class="" style="white-space:pre">  </span>at ch.qos.logback.classic.gaffer.ComponentDelegate.propertyMissing(ComponentDelegate.groovy:94)</div><div><span class="" style="white-space:pre">    </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="" style="white-space:pre">     </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div><span class="" style="white-space:pre">   </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span class="" style="white-space:pre">   </span>at java.lang.reflect.Method.invoke(Method.java:483)</div><div><span class="" style="white-space:pre">        </span>at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)</div><div><span class="" style="white-space:pre">        </span>at groovy.lang.MetaClassImpl.invokeMissingProperty(MetaClassImpl.java:778)</div><div><span class="" style="white-space:pre"> </span>at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1615)</div><div><span class="" style="white-space:pre">  </span>at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3343)</div><div><span class="" style="white-space:pre">  </span>at ch.qos.logback.classic.gaffer.ComponentDelegate.getProperty(ComponentDelegate.groovy)</div><div><span class="" style="white-space:pre">   </span>at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:169)</div><div><span class="" style="white-space:pre">   </span>at groovy.lang.Closure.getPropertyTryThese(Closure.java:322)</div><div><span class="" style="white-space:pre">       </span>at groovy.lang.Closure.getPropertyDelegateFirst(Closure.java:312)</div><div><span class="" style="white-space:pre">  </span>at groovy.lang.Closure.getProperty(Closure.java:297)</div><div><span class="" style="white-space:pre">       </span>at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:47)</div><div><span class="" style="white-space:pre">       </span>at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)</div><div><span class="" style="white-space:pre">    </span>at Script1$_run_closure2.doCall(Script1.groovy:51)</div><div><span class="" style="white-space:pre"> </span>at Script1$_run_closure2.doCall(Script1.groovy)</div><div><span class="" style="white-space:pre">    </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="" style="white-space:pre">     </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div><span class="" style="white-space:pre">   </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span class="" style="white-space:pre">   </span>at java.lang.reflect.Method.invoke(Method.java:483)</div><div><span class="" style="white-space:pre">        </span>at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)</div><div><span class="" style="white-space:pre">        </span>at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)</div><div><span class="" style="white-space:pre">      </span>at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)</div><div><span class="" style="white-space:pre">  </span>at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)</div><div><span class="" style="white-space:pre">  </span>at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)</div><div><span class="" style="white-space:pre">  </span>at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)</div><div><span class="" style="white-space:pre">   </span>at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)</div><div><span class="" style="white-space:pre">  </span>at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)</div><div><span class="" style="white-space:pre">   </span>at ch.qos.logback.classic.gaffer.ConfigurationDelegate.appender(ConfigurationDelegate.groovy:141)</div><div><span class="" style="white-space:pre">  </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="" style="white-space:pre">     </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div><span class="" style="white-space:pre">   </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span class="" style="white-space:pre">   </span>at java.lang.reflect.Method.invoke(Method.java:483)</div><div><span class="" style="white-space:pre">        </span>at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)</div><div><span class="" style="white-space:pre">        </span>at org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod.invoke(MixinInstanceMetaMethod.java:53)</div><div><span class="" style="white-space:pre">   </span>at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:313)</div><div><span class="" style="white-space:pre">  </span>at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)</div><div><span class="" style="white-space:pre"> </span>at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)</div><div><span class="" style="white-space:pre">    </span>at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)</div><div><span class="" style="white-space:pre">    </span>at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)</div><div><span class="" style="white-space:pre">    </span>at Script1.run(Script1.groovy:50)</div><div><span class="" style="white-space:pre">  </span>at Script1$run.call(Unknown Source)</div><div><span class="" style="white-space:pre">        </span>at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)</div><div><span class="" style="white-space:pre">   </span>at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)</div><div><span class="" style="white-space:pre">   </span>at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)</div><div><span class="" style="white-space:pre">   </span>at ch.qos.logback.classic.gaffer.GafferConfigurator.run(GafferConfigurator.groovy:77)</div><div><span class="" style="white-space:pre">      </span>at ch.qos.logback.classic.gaffer.GafferConfigurator$run.callCurrent(Unknown Source)</div><div><span class="" style="white-space:pre">        </span>at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)</div><div><span class="" style="white-space:pre">    </span>at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)</div><div><span class="" style="white-space:pre">    </span>at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)</div><div><span class="" style="white-space:pre">    </span>at ch.qos.logback.classic.gaffer.GafferConfigurator.run(GafferConfigurator.groovy:44)</div><div><span class="" style="white-space:pre">      </span>at ch.qos.logback.classic.gaffer.GafferUtil.runGafferConfiguratorOn(GafferUtil.java:43)</div><div><span class="" style="white-space:pre">    </span>at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:66)</div><div><span class="" style="white-space:pre">  </span>at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)</div><div><span class="" style="white-space:pre">  </span>at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)</div><div><span class="" style="white-space:pre">      </span>at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)</div><div><span class="" style="white-space:pre">    </span>at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)</div><div><span class="" style="white-space:pre">    </span>at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)</div><div><span class="" style="white-space:pre">   </span>at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)</div><div><span class="" style="white-space:pre">       </span>at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)</div><div><span class="" style="white-space:pre">       </span>at com.github.tomakehurst.wiremock.common.Slf4jNotifier.<clinit>(Slf4jNotifier.java:23)</div><div><span class="" style="white-space:pre">      </span>at com.github.tomakehurst.wiremock.core.WireMockConfiguration.<init>(WireMockConfiguration.java:52)</div><div><span class="" style="white-space:pre">  </span>at com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig(WireMockConfiguration.java:65)</div><div><span class="" style="white-space:pre">        </span>at com.....RunIntegrationTest.<clinit>(RunIntegrationTest.java:19)</div><div><span class="" style="white-space:pre">   </span>at sun.misc.Unsafe.ensureClassInitialized(Native Method)</div><div><span class="" style="white-space:pre">   </span>at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)</div><div><span class="" style="white-space:pre">     </span>at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:142)</div><div><span class="" style="white-space:pre">      </span>at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1082)</div><div><span class="" style="white-space:pre">   </span>at java.lang.reflect.Field.getFieldAccessor(Field.java:1063)</div><div><span class="" style="white-space:pre">       </span>at java.lang.reflect.Field.get(Field.java:387)</div><div><span class="" style="white-space:pre">     </span>at org.junit.runners.model.FrameworkField.get(FrameworkField.java:69)</div><div><span class="" style="white-space:pre">      </span>at org.junit.runners.model.TestClass.getAnnotatedFieldValues(TestClass.java:156)</div><div><span class="" style="white-space:pre">   </span>at org.junit.runners.ParentRunner.classRules(ParentRunner.java:215)</div><div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner.withClassRules(ParentRunner.java:203)</div><div><span class="" style="white-space:pre">    </span>at org.junit.runners.ParentRunner.classBlock(ParentRunner.java:163)</div><div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner.run(ParentRunner.java:308)</div><div><span class="" style="white-space:pre">       </span>at cucumber.api.junit.Cucumber.run(Cucumber.java:98)</div><div><span class="" style="white-space:pre">       </span>at org.junit.runner.JUnitCore.run(JUnitCore.java:160)</div><div><span class="" style="white-space:pre">      </span>at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)</div><div><span class="" style="white-space:pre">      </span>at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)</div><div><span class="" style="white-space:pre">      </span>at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)</div><div><span class="" style="white-space:pre"> </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="" style="white-space:pre">     </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div><span class="" style="white-space:pre">   </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span class="" style="white-space:pre">   </span>at java.lang.reflect.Method.invoke(Method.java:483)</div><div><span class="" style="white-space:pre">        </span>at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)</div></div><div><br></div><div>Thanks</div><div><br></div><div>Mik</div><div><br></div><div><br></div><div><br></div><div><br></div></div></div>