title: logback.groovy configuration not working after groovy update
body: <p>Working a project update, we updated groovy dependency for our java (gradle) project to version 4.0.4. Now, however, our <strong>logback.groovy</strong> configuration is no longer working.
  The issue is that the appender property closures no longer seem to apply to the property that we are configuring (eg. <strong>PatternLayoutEncoder</strong>), but the appender itself.</p>
  <p>versions:</p>
  <ul>
  <li>logback-classic: <strong>ch.qos.logback:logback-classic:1.2.7</strong></li>
  <li>groovy: <strong>org.apache.groovy:groovy-all:4.0.4</strong></li>
  </ul>
  <p>previous groovy version was <code>2.5.x</code>.</p>
  <p>Simple logback.groovy file:</p>
  <pre><code>statusListener(OnConsoleStatusListener)
  
  appender(&quot;CONSOLE&quot;, ConsoleAppender) {
      encoder(PatternLayoutEncoder) {
          pattern = &quot;%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n&quot;
      }
  }
  
  root(DEBUG, [&quot;CONSOLE&quot;])
  </code></pre>
  <p>error log:</p>
  <pre><code>09:02:39,743 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79f227a9 - Added status listener of type [ch.qos.logback.core.status.OnConsoleStatusListener]
  09:02:39,810 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79f227a9 - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
  09:02:39,812 |-INFO in ch.qos.logback.classic.gaffer.ConfigurationDelegate@79f227a9 - Naming appender as [CONSOLE]
  09:02:39,913 |-ERROR in ch.qos.logback.classic.gaffer.AppenderDelegate@27e32fe4 - Appender [CONSOLE] of type [ch.qos.logback.core.ConsoleAppender] has no appplicable [pattern] property 
  Failed to instantiate [ch.qos.logback.classic.LoggerContext]
  Reported exception:
  java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Iterator (java.lang.String and java.util.Iterator are in module java.base of loader 'bootstrap')
      at com.sun.proxy.$Proxy17.iterator(Unknown Source)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.toList(DefaultGroovyMethods.java:3293)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.asCollection(DefaultGroovyMethods.java:11550)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.minus(DefaultGroovyMethods.java:13702)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.minus(DefaultGroovyMethods.java:13609)
      at org.codehaus.groovy.runtime.dgm$523.doMethodInvoke(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrap.invoke(PojoMetaMethodSite.java:234)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:57)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
      at ch.qos.logback.classic.gaffer.ComponentDelegate.analyzeArgs(ComponentDelegate.groovy:111)
      at ch.qos.logback.classic.gaffer.ComponentDelegate$analyzeArgs.callCurrent(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
      at ch.qos.logback.classic.gaffer.ComponentDelegate.methodMissing(ComponentDelegate.groovy:49)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
      at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:926)
      at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1451)
      at groovy.lang.MetaClassImpl.doInvokeMethod(MetaClassImpl.java:1373)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1103)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1009)
      at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:610)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:593)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:391)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:330)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1009)
      at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
      at Script1$_run_closure1.doCall(Script1.groovy:4)
      at Script1$_run_closure1.doCall(Script1.groovy)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1009)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
      at ch.qos.logback.classic.gaffer.ConfigurationDelegate.appender(ConfigurationDelegate.groovy:143)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
      at org.codehaus.groovy.runtime.metaclass.MixinInstanceMetaMethod.invoke(MixinInstanceMetaMethod.java:61)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
      at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
      at Script1.run(Script1.groovy:3)
      at Script1$run.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
      at ch.qos.logback.classic.gaffer.GafferConfigurator.run(GafferConfigurator.groovy:77)
      at ch.qos.logback.classic.gaffer.GafferConfigurator$run.callCurrent(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
      at ch.qos.logback.classic.gaffer.GafferConfigurator.run(GafferConfigurator.groovy:44)
      at ch.qos.logback.classic.gaffer.GafferUtil.runGafferConfiguratorOn(GafferUtil.java:43)
      at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:67)
      at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
      at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
      at org.slf4j.impl.StaticLoggerBinder.&lt;clinit&gt;(StaticLoggerBinder.java:55)
      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
  </code></pre>
  <p>This looks like the main error: <code>Appender [CONSOLE] of type [ch.qos.logback.core.ConsoleAppender] has no appplicable [pattern]</code>, though <code>java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Iterator (java.lang.String and java.util.Iterator are in module java.base of loader 'bootstrap')</code> could be something else as well, I guess.</p>
  <p>XML configuration seems to work fine (and I know that groovy config is deprecated), but we have a ton of logback.groovy configuration files in various places and would like to use those for the time being, if possible...</p>