final class Slf4jLoggerProvider extends AbstractLoggerProvider implements LoggerProvider
Constructor and Description |
---|
Slf4jLoggerProvider() |
Modifier and Type | Method and Description |
---|---|
void |
clearMdc()
Removes all entries from the message diagnostics context.
|
Logger |
getLogger(java.lang.String name)
Returns a logger which is backed by a logger from the log provider.
|
java.lang.Object |
getMdc(java.lang.String key)
Returns the value for the key on the message diagnostics context or
null if no value was found. |
java.util.Map<java.lang.String,java.lang.Object> |
getMdcMap()
Returns the map from the context.
|
java.lang.Object |
putMdc(java.lang.String key,
java.lang.Object value)
Puts the value onto the message diagnostics context.
|
void |
removeMdc(java.lang.String key)
Removes the value from the message diagnostics context.
|
clearNdc, getNdc, getNdcDepth, peekNdc, popNdc, pushNdc, setNdcMaxDepth
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearNdc, getNdc, getNdcDepth, peekNdc, popNdc, pushNdc, setNdcMaxDepth
public Logger getLogger(java.lang.String name)
LoggerProvider
Note: this should never be null
getLogger
in interface LoggerProvider
name
- the name of the loggerpublic void clearMdc()
LoggerProvider
clearMdc
in interface LoggerProvider
public java.lang.Object putMdc(java.lang.String key, java.lang.Object value)
LoggerProvider
putMdc
in interface LoggerProvider
key
- the key for the valuevalue
- the valuenull
if no value was setpublic java.lang.Object getMdc(java.lang.String key)
LoggerProvider
null
if no value was found.getMdc
in interface LoggerProvider
key
- the key to lookup the value fornull
if not foundpublic void removeMdc(java.lang.String key)
LoggerProvider
removeMdc
in interface LoggerProvider
key
- the key of the value to removepublic java.util.Map<java.lang.String,java.lang.Object> getMdcMap()
LoggerProvider
Note that in most implementations this is an expensive operation and should be used sparingly.
getMdcMap
in interface LoggerProvider
null