All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.tracee.backend.slf4j.Slf4jMdcAdapter Maven / Gradle / Ivy

There is a newer version: 0.11.0
Show newest version
package io.tracee.backend.slf4j;

import io.tracee.MDCLike;
import org.slf4j.MDC;

import java.util.Map;

final class Slf4jMdcAdapter implements MDCLike {

	@Override
    public boolean containsKey(String key) {
        return MDC.get(key) != null;
    }

    @Override
    public void put(String key, String value) {
        MDC.put(key, value);
    }

    @Override
    public String get(String key) {
        return MDC.get(key);
    }

    @Override
    public void remove(String key) {
        MDC.remove(key);
    }

    @Override
    @SuppressWarnings("unchecked")
    public Map getCopyOfContext() {
        return (Map) MDC.getCopyOfContextMap();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy