We decided to move from centOS to Ubuntu 22.04 for our Jenkins server. We use a common-framework dependency to manage the common-configurations across all of our spring-boot micro-services. This common framework has the logback-configuration.xml which has the logging pattern configuration.
We have a micro-service A, which uses common-framework dependency. We successfully built the common framework and service A, but while deploying to Kubernetes we got the below exception,
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.classic.PatternLayout("") - Empty or null pattern.
ERROR in ch.qos.logback.classic.PatternLayout("") - Empty or null pattern.
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:80)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
In the environment we use this encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder" to encode the log pattern into a JSON structure using this appender class="ch.qos.logback.core.ConsoleAppender".
We decided to move from centOS to Ubuntu 22.04 for our Jenkins server. We use a common-framework dependency to manage the common-configurations across all of our spring-boot micro-services. This common framework has the logback-configuration.xml which has the logging pattern configuration.
We have a micro-service A, which uses common-framework dependency. We successfully built the common framework and service A, but while deploying to Kubernetes we got the below exception,
In the environment we use this encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder" to encode the log pattern into a JSON structure using this appender class="ch.qos.logback.core.ConsoleAppender".
Configuration -
We are using version 1.2.11 for logback, version 4.9 for net.logstash.logback.
The same configuration works on the local machine (windows/11) and when the image is built using the Jenkins-server running on the centOS.