title: Log back configuration error while running JUnit
body: <p>I configured logback.xml in my application and it's working fine. But after working some days, while running Junit test cases i got the below error.</p>
  
  <pre><code>java.lang.IllegalStateException: Logback configuration error detected: 
  ERROR in ch.qos.logback.core.rolling.RollingFileAppender[STDOUT] - Appender [STDOUT] failed to append. java.lang.IllegalArgumentException: Cannot convert 1 of typejava.lang.Integer
  ERROR in ch.qos.logback.core.rolling.RollingFileAppender[STDOUT] - Appender [STDOUT] failed to append. java.lang.NullPointerException
  ERROR in ch.qos.logback.core.rolling.RollingFileAppender[STDOUT] - Appender [STDOUT] failed to append. java.lang.NullPointerException
              at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:169)
              at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:82)
              at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
              at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:117)
              at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:292)
              at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:265)
              at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:228)
              at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:201)
              at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
              at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
              at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
              at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
              at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75)
              at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
              at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347)
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
              at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:127)
              at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
              at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)
              at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108)
              at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)
              at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)
              at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
              at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
              at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
              at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
              at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
              at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  11:56:03.388 [main] ERROR o.s.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@2b30a42c] to prepare test instance [com.test.demo.cq.model.CqTest@f107c50]
  java.lang.IllegalStateException: Failed to load ApplicationContext
              at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)
              at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108)
              at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)
              at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)
              at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
              at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
              at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
              at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
              at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
              at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
              at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  
  </code></pre>
  
  <p>Below is my logback.xml code</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;property name="HOME_LOG" value="logs/app.log" /&gt;
      &lt;appender name="classicConsoleAppender" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;encoder&gt;
              &lt;pattern&gt;%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
              &lt;/pattern&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
      &lt;appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender"&gt;
          &lt;encoder class="net.logstash.logback.encoder.LogstashEncoder" /&gt;
      &lt;/appender&gt;
      &lt;root level="INFO"&gt;
          &lt;appender-ref ref="classicConsoleAppender" /&gt;
          &lt;!-- &lt;appender-ref ref="jsonConsoleAppender"/&gt; --&gt;
      &lt;/root&gt;
  
      &lt;appender name="STDOUT"
          class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
          &lt;file&gt;${HOME_LOG}&lt;/file&gt;
  
          &lt;rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"&gt;
              &lt;maxIndex&gt;1&lt;/maxIndex&gt;
              &lt;fileNamePattern&gt;logs/archived/app.%d{yyyy-MM-dd}.%i.log
              &lt;/fileNamePattern&gt;
          &lt;/rollingPolicy&gt;
  
          &lt;triggeringPolicy
              class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"&gt;
              &lt;MaxFileSize&gt;1MB&lt;/MaxFileSize&gt;
          &lt;/triggeringPolicy&gt;
  
          &lt;encoder
              class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"&gt;
              &lt;providers&gt;
                  &lt;timestamp&gt;
                      &lt;timeZone&gt;UTC&lt;/timeZone&gt;
                  &lt;/timestamp&gt;
                  &lt;uuid&gt;
                      &lt;fieldName&gt;id&lt;/fieldName&gt;
                      &lt;strategy&gt;time&lt;/strategy&gt;
                      &lt;ethernet&gt;00:C0:F0:3D:5B:7C&lt;/ethernet&gt;
                  &lt;/uuid&gt;
                  &lt;callerData&gt;
                      &lt;classFieldName&gt;classname&lt;/classFieldName&gt;
                      &lt;methodFieldName&gt;method&lt;/methodFieldName&gt;
                      &lt;fileFieldName&gt;file&lt;/fileFieldName&gt;
                      &lt;lineFieldName&gt;line&lt;/lineFieldName&gt;
                  &lt;/callerData&gt;
                  &lt;threadName&gt;
                      &lt;fieldName&gt;thread&lt;/fieldName&gt;
                  &lt;/threadName&gt;
                  &lt;loggerName /&gt;
                  &lt;logLevel /&gt;
                  &lt;message /&gt;
                  &lt;mdc /&gt;
                  &lt;arguments&gt;
                      &lt;includeNonStructuredArguments&gt;true&lt;/includeNonStructuredArguments&gt;
                  &lt;/arguments&gt;
                  &lt;logstashMarkers /&gt;
                  &lt;stackTrace /&gt;
              &lt;/providers&gt;
          &lt;/encoder&gt;
      &lt;/appender&gt;
  
      &lt;root level="INFO"&gt;
          &lt;appender-ref ref="STDOUT" /&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I am unable to figure it out the issue. It seems Rolling file is not generating after reached max size. Any help Appreciated.</p>