I have a Springboot application with Logback. This war is running in a Liberty webserver in a docker container
Versions:Springboot 2.5.3Logback 1.2.3
I am seeing a weird behavior where if I run this container on a Mac or Redhat, the application starts up fine and logs as expected.However, when the same docker container is run in Ubuntu, I am seeing the following error from Logback's Joran interpreter :
...08:07:53,308 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.springframework] to WARN08:07:53,308 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.hibernate] to WARN08:07:53,308 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [springfox] to WARN08:07:53,313 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@88:32 - no applicable action for [springProfile], current ElementPath is [[configuration][springProfile]]08:07:53,313 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@89:51 - no applicable action for [root], current ElementPath is [[configuration][springProfile][root]]08:07:53,314 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@90:73 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][root][appender-ref]]08:07:53,314 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.08:07:53,314 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5b3de2a2 - Registering current configuration as safe fallback point[err] Logging system failed to initialize using configuration from '/logback-spring.xml'[err] java.lang.IllegalStateException: Logback configuration error detected: ERROR in ch.qos.logback.core.joran.spi.Interpreter@88:32 - no applicable action for [springProfile], current ElementPath is [[configuration][springProfile]]ERROR in ch.qos.logback.core.joran.spi.Interpreter@89:51 - no applicable action for [root], current ElementPath is [[configuration][springProfile][root]]ERROR in ch.qos.logback.core.joran.spi.Interpreter@90:73 - no applicable action for [appender-ref], current ElementPath is [[configuration][springProfile][root][appender-ref]][err] at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)[err] at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)[err] at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)[err] at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)[err] at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:316)[err] at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282)[err] at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240)[err] at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)[err] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)[err] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)[err] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)[err] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)[err] at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)[err] at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)[err] at org.springframework.boot.SpringApplicationRunListeners$$Lambda$71/0x000000006c31f840.accept(Unknown Source)[err] at java.util.ArrayList.forEach(ArrayList.java:1270)[err] at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)[err] at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)[err] at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)[err] at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:374)[err] at org.springframework.boot.SpringApplication.run(SpringApplication.java:332)[err] at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:175)[err] at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:155)[err] at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:97)[err] at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)[err] at com.ibm.ws.webcontainer.webapp.WebApp.initializeServletContainerInitializers(WebApp.java:2550)[err] at [internal classes][err] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)[err] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)[err] at java.lang.Thread.run(Thread.java:822)Here is my logback configuration:
<?xml version="1.0" encoding="UTF-8"?><configuration><appender name="console-json" class="ch.qos.logback.core.ConsoleAppender"><encoder name="LoggingEventCompositeJsonEncoder" class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"><providers><timestamp/><version/><message/><loggerName><shortenedLoggerNameLength>20</shortenedLoggerNameLength></loggerName><threadName/><logLevel/><logLevelValue/><callerData><fieldName>caller</fieldName><classFieldName>class</classFieldName><methodFieldName>method</methodFieldName><fileFieldName>file</fileFieldName><lineFieldName>line</lineFieldName></callerData><stackTrace><throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter"><maxDepthPerThrowable>100</maxDepthPerThrowable><maxLength>10000</maxLength><shortenedClassNameLength>30</shortenedClassNameLength><rootCauseFirst>true</rootCauseFirst><inlineHash>true</inlineHash></throwableConverter></stackTrace><stackHash/><jsonMessage/><mdc/><contextMap/><tags/><logstashMarkers/><arguments><includeNonStructuredArguments>true</includeNonStructuredArguments><nonStructuredArgumentsFieldPrefix>prefix</nonStructuredArgumentsFieldPrefix></arguments></providers></encoder></appender><logger name="org.springframework" level="WARN"/><logger name="org.hibernate" level="WARN"/><logger name="springfox" level="WARN"/><springProfile name="prod"><root level="${logback_root_level:-INFO}"><appender-ref ref="${logback_root_appender:-console-json}"/></root></springProfile><springProfile name="minimal"><root level="${logback_root_level:-WARN}"><appender-ref ref="${logback_root_appender:-console-json}"/></root></springProfile></configuration>Any help is appreciated!