|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.util.logging.LoggingContext
public final class LoggingContext
Manages contextual information in the Log4J Mapped Diagnostic Context.
PatternLayoutWithContext
,
LoggingContextFilter
,
MDC
Method Summary | |
---|---|
static void |
clear()
Removes all keys from the logging context which are managed by this class. |
static void |
clearAll()
Clears all MDC information on the current thread. |
static java.util.Map<java.lang.String,java.lang.Object> |
getContext()
Returns an immutable copy of the underlying logging context map. |
static java.lang.String |
getUserName()
Returns the currently mapped 'userName' value from the context, or null if none has been
set. |
static boolean |
isEmpty()
Returns true if the logging context has been initialised and has data in it, otherwise
false . |
static void |
put(java.lang.String key,
java.lang.String value)
Sets the value associated with the key in the logging context, overwriting any existing value. |
static void |
remove(java.lang.String... keys)
Removes any value associated with the keys in the logging context. |
static void |
setReferer(java.lang.String referer)
Sets the 'referer' value in the logging context. |
static void |
setUrl(java.lang.String url)
Sets the 'url' value in the logging context. |
static void |
setUserName(java.lang.String userName)
Sets the 'userName' value in the logging context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setUrl(java.lang.String url)
null
.
public static void setUserName(java.lang.String userName)
null
.
public static java.lang.String getUserName()
null
if none has been
set.
public static void setReferer(java.lang.String referer)
null
.
public static void put(java.lang.String key, java.lang.String value)
remove(java.lang.String...)
with the same key in a finally block.
MDC.put(java.lang.String, java.lang.Object)
public static void remove(java.lang.String... keys)
public static boolean isEmpty()
true
if the logging context has been initialised and has data in it, otherwise
false
.
public static java.util.Map<java.lang.String,java.lang.Object> getContext()
public static void clear()
put(java.lang.String, java.lang.String)
needs to be removed by calling remove(java.lang.String...)
with the same
key.
public static void clearAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |