final class JBossLogManagerProvider extends java.lang.Object implements LoggerProvider
| Modifier and Type | Field and Description |
|---|---|
private static org.jboss.logmanager.Logger.AttachmentKey<Logger> |
KEY |
private static org.jboss.logmanager.Logger.AttachmentKey<java.util.concurrent.ConcurrentMap<java.lang.String,Logger>> |
LEGACY_KEY |
| Constructor and Description |
|---|
JBossLogManagerProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearMdc()
Removes all entries from the message diagnostics context.
|
void |
clearNdc()
Clears the nested diagnostics context.
|
private static Logger |
doGetLogger(java.lang.String name) |
private static Logger |
doLegacyGetLogger(java.lang.String name) |
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.String |
getNdc()
Retrieves the current values set for the nested diagnostics context.
|
int |
getNdcDepth()
The current depth of the nested diagnostics context.
|
java.lang.String |
peekNdc()
Peeks at the top value from the stack and returns it.
|
java.lang.String |
popNdc()
Pops top value from the stack and returns it.
|
void |
pushNdc(java.lang.String message)
Pushes a value to the nested diagnostics context stack.
|
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.
|
void |
setNdcMaxDepth(int maxDepth)
Sets maximum depth of the stack removing any entries below the maximum depth.
|
private static final org.jboss.logmanager.Logger.AttachmentKey<Logger> KEY
private static final org.jboss.logmanager.Logger.AttachmentKey<java.util.concurrent.ConcurrentMap<java.lang.String,Logger>> LEGACY_KEY
public Logger getLogger(java.lang.String name)
LoggerProvider
Note: this should never be null
getLogger in interface LoggerProvidername - the name of the loggerprivate static Logger doLegacyGetLogger(java.lang.String name)
private static Logger doGetLogger(java.lang.String name)
public void clearMdc()
LoggerProviderclearMdc in interface LoggerProviderpublic java.lang.Object putMdc(java.lang.String key,
java.lang.Object value)
LoggerProviderputMdc in interface LoggerProviderkey - the key for the valuevalue - the valuenull if no value was setpublic java.lang.Object getMdc(java.lang.String key)
LoggerProvidernull if no value was found.getMdc in interface LoggerProviderkey - the key to lookup the value fornull if not foundpublic void removeMdc(java.lang.String key)
LoggerProviderremoveMdc in interface LoggerProviderkey - the key of the value to removepublic java.util.Map<java.lang.String,java.lang.Object> getMdcMap()
LoggerProviderNote that in most implementations this is an expensive operation and should be used sparingly.
getMdcMap in interface LoggerProvidernullpublic void clearNdc()
LoggerProviderclearNdc in interface LoggerProviderpublic java.lang.String getNdc()
LoggerProvidergetNdc in interface LoggerProvidernull if no value was setpublic int getNdcDepth()
LoggerProvidergetNdcDepth in interface LoggerProviderpublic java.lang.String popNdc()
LoggerProviderpopNdc in interface LoggerProviderpublic java.lang.String peekNdc()
LoggerProviderpeekNdc in interface LoggerProviderpublic void pushNdc(java.lang.String message)
LoggerProviderpushNdc in interface LoggerProvidermessage - the message to pushpublic void setNdcMaxDepth(int maxDepth)
LoggerProvidersetNdcMaxDepth in interface LoggerProvidermaxDepth - the maximum depth to set