为什么logback StaticMDCBinder hash 高优先级

问题描述 投票:0回答:0

我也写了一个org.slf4j.impl.StaticMDCBinder,但是总是logback优先加载的StaticMDCBinder。

如何优雅地确定我的 org.slf4j.impl.StaticMDCBinder 的优先级;

package org.slf4j.impl;

import cn.jugg.agile.core.dapper.log.JaMDCAdapter;
import org.slf4j.spi.MDCAdapter;

// my StaticMDCBinder 
public class StaticMDCBinder {

    private static final StaticMDCBinder instance = new StaticMDCBinder();

    private StaticMDCBinder() {
    }

    public static StaticMDCBinder getSingleton() {
        return instance;
    }

    public MDCAdapter getMDCA() {
        return new JaMDCAdapter();
    }
}
java logback slf4j mdc
© www.soinside.com 2019 - 2024. All rights reserved.