io.microlam.slf4j.simple.SimpleServiceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of slf4j-simple-lambda Show documentation
Show all versions of slf4j-simple-lambda Show documentation
SLF4J Simple binding for AWS Lambda
package io.microlam.slf4j.simple;
import org.slf4j.ILoggerFactory;
import org.slf4j.IMarkerFactory;
import org.slf4j.helpers.BasicMDCAdapter;
import org.slf4j.helpers.BasicMarkerFactory;
import org.slf4j.spi.MDCAdapter;
import org.slf4j.spi.SLF4JServiceProvider;
public class SimpleServiceProvider implements SLF4JServiceProvider {
/**
* Declare the version of the SLF4J API this implementation is compiled against.
* The value of this field is modified with each major release.
*/
// to avoid constant folding by the compiler, this field must *not* be final
public static String REQUESTED_API_VERSION = "2.0"; // !final
private ILoggerFactory loggerFactory;
private IMarkerFactory markerFactory;
private MDCAdapter mdcAdapter;
public ILoggerFactory getLoggerFactory() {
return loggerFactory;
}
public IMarkerFactory getMarkerFactory() {
return markerFactory;
}
public MDCAdapter getMDCAdapter() {
return mdcAdapter;
}
public String getRequestedApiVersion() {
return REQUESTED_API_VERSION;
}
@Override
public void initialize() {
mdcAdapter = new BasicMDCAdapter();
loggerFactory = new SimpleLoggerFactory(mdcAdapter);
markerFactory = new BasicMarkerFactory();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy