Showing posts from August, 2016

Configure MDC with SLF4j Logback file in java

This article is all about how you configure MDC logs with SLF4J and logback.

1. Maven POM dependencies: Please add maven dependencies as given below.

     <!-- Logging with SLF4J & LogBack -->

2. Configure logback.xml file

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">

<property name="DEV_HOME" value="c:/logs" />
    <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">

<appender name="FILE-THREAD" class="ch.qos…