I need to add an additional logging layer to a project (SpringBoot+LogBack). Currently some fields are added to the MDC to be included in the logs, which is fine.
In the new logging layer, I use a new appender and logger and I need to exclude the MDC fields from these log entries, is that possible?
Found a solution, posting it as an answer to save time for others. It is possible using logback logstash encoder. You simply can add <includeMdc>false</includeMdc>
to the appender.