Microservice Java SDK overwriting logback config?!

I have a microservice developed and build with the Microservice Java SDK.
I added a logback-spring.xml to my resources folder to configure my log appenders and log aggregation tool.
Unfortunately when my microservice is deployed I only see the first entry in my log aggregation tool:

2024-04-17 10:18:19.521 l=INFO c=c.c.m.l.c.LoggingEnvironmentRunListener t=main | logging.conf: /etc/dynamic-mapping-service/dynamic-mapping-service-logging.xml 

Everything else is not forwarded.

So I ran the image locally and detected that in my image my logging config will be overwritten by the file /etc/dynamic-mapping-service/dynamic-mapping-service-logging.xml directly after starting the microservice. This file seems to be generated by the SDK.

Btw. If I run the microservice natively everything work as expected. Only the image created on package seems to be faulty with a logging config I don’t want to use.

A few questions:

  1. How can I overwrite the generated logging.xml and use my logging config?
  2. Why is my logback-spring.xml file in the resources folder overwritten by this default file?

Thx to @apes I found the very strange & confusing solution in my opinion.

You have to put a file in the following format to the configuration folder of your microservice:
<artifactId>-logging.xml

It is not sufficient to put a logback-spring.xml or logging.xml in your resources folder which is the normal way to configure logback of your spring boot application.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.