0

One of my spring boot applications suddenly stopped working, after server restart. The application is failing to start, these are the messages from log file

ERROR o.s.boot.SpringApplication - Application startup failed 
java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.classic.PatternLayout("") - Empty or null pattern.

Server: WebSphere Application Server

Spring Boot version: 1.5.21.RELEASE

logback-spring.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<appender name="ROLLING-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
<file>app.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>app.log.%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
</appender>
<root level="INFO">
<appender-ref ref="ROLLING-FILE"/>
</root>
</configuration>

I tried setting the log parameters in the application properties file but still doesn't work, properties like logging.path, logging.file, logging.pattern.file

The application used to work fine, no code changes were made for last few months, but after server restart it stopped working, application works fine in my local machine.

aryanRaj_kary
  • 503
  • 2
  • 7
  • 28

1 Answers1

0

For people that might still be looking for an answer. We were able to solve this by editing our logback-spring xml by removing:

<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>

and if present (it was in our file but not in the code posted in the question) remove:

<appender-ref ref="CONSOLE"/>
President James K. Polk
  • 40,516
  • 21
  • 95
  • 125
  • 2
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 30 '21 at 13:58
  • @SuzyMargaretha Removing what? – tubensandwich Jul 26 '22 at 17:50