package org.slf4j.impl;

import org.slf4j.spi.MDCAdapter;

/**
 * @author Pengtao Qiu
 */
public class StaticMDCBinder {

    /**
     * The unique instance of this class.
     */
    public static final StaticMDCBinder SINGLETON = new StaticMDCBinder();

    private StaticMDCBinder() {
    }

    public MDCAdapter getMDCA() {
        return new MDCAdapterImpl();
    }

    public String getMDCAdapterClassStr() {
        return MDCAdapterImpl.class.getName();
    }
}

@@ -18,16 +18,55 @@
 .impl;%0A%0A
+import com.firefly.utils.ServiceUtils;%0A
 import o
@@ -90,16 +90,16 @@
 dapter;%0A
-
 %0A/**%0A * 
@@ -286,16 +286,45 @@
 inder();
+%0A    private MDCAdapter mdca;
 %0A%0A    pr
@@ -345,24 +345,119 @@
 CBinder() %7B%0A
+        mdca = ServiceUtils.loadService(org.slf4j.spi.MDCAdapter.class, new MDCAdapterImpl());%0A
     %7D%0A%0A    p
@@ -500,36 +500,20 @@
  return 
-new MDCAdapterImpl()
+mdca
 ;%0A    %7D%0A
@@ -576,28 +576,23 @@
 urn 
-MDCAdapterImpl.c
+mdca.getC
 lass
+()
 .get

add MDC service loader