com.devonfw.module.logging.common.impl.DiagnosticContextFacadeImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of devon4j-logging Show documentation
Show all versions of devon4j-logging Show documentation
Logging Module of the Open Application Standard Platform for Java (devon4j).
package com.devonfw.module.logging.common.impl;
import org.slf4j.MDC;
import com.devonfw.module.logging.common.api.DiagnosticContextFacade;
import com.devonfw.module.logging.common.api.LoggingConstants;
/**
* This is the simple and straight forward implementation of {@link DiagnosticContextFacade}.
*
*/
public class DiagnosticContextFacadeImpl implements DiagnosticContextFacade {
/**
* The constructor.
*/
public DiagnosticContextFacadeImpl() {
super();
}
@Override
public String getCorrelationId() {
return MDC.get(LoggingConstants.CORRELATION_ID);
}
@Override
public void setCorrelationId(String correlationId) {
MDC.put(LoggingConstants.CORRELATION_ID, correlationId);
}
@Override
public void removeCorrelationId() {
MDC.remove(LoggingConstants.CORRELATION_ID);
}
}