Interface LoggerProvider
- All Known Implementing Classes:
JBossLogManagerProvider, JDKLoggerProvider, Log4j2LoggerProvider, Log4jLoggerProvider, Slf4jLoggerProvider
public interface LoggerProvider
A contract for the log provider implementation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearMdc()Removes all entries from the message diagnostics context.voidclearNdc()Clears the nested diagnostics context.Returns a logger which is backed by a logger from the log provider.Returns the value for the key on the message diagnostics context ornullif no value was found.Returns the map from the context.getNdc()Retrieves the current values set for the nested diagnostics context.intThe current depth of the nested diagnostics context.peekNdc()Peeks at the top value from the stack and returns it.popNdc()Pops top value from the stack and returns it.voidPushes a value to the nested diagnostics context stack.Puts the value onto the message diagnostics context.voidRemoves the value from the message diagnostics context.voidsetNdcMaxDepth(int maxDepth) Sets maximum depth of the stack removing any entries below the maximum depth.
-
Method Details
-
getLogger
-
clearMdc
void clearMdc()Removes all entries from the message diagnostics context. -
putMdc
-
getMdc
-
removeMdc
Removes the value from the message diagnostics context.- Parameters:
key- the key of the value to remove
-
getMdcMap
-
clearNdc
void clearNdc()Clears the nested diagnostics context. -
getNdc
String getNdc()Retrieves the current values set for the nested diagnostics context.- Returns:
- the current value set or
nullif no value was set
-
getNdcDepth
int getNdcDepth()The current depth of the nested diagnostics context.- Returns:
- the current depth of the stack
-
popNdc
String popNdc()Pops top value from the stack and returns it.- Returns:
- the top value from the stack or an empty string if no value was set
-
peekNdc
String peekNdc()Peeks at the top value from the stack and returns it.- Returns:
- the value or an empty string
-
pushNdc
Pushes a value to the nested diagnostics context stack.- Parameters:
message- the message to push
-
setNdcMaxDepth
void setNdcMaxDepth(int maxDepth) Sets maximum depth of the stack removing any entries below the maximum depth.- Parameters:
maxDepth- the maximum depth to set
-