|
JBoss Log Manager 1.4.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.logmanager.LogContext
public final class LogContext
A logging context, for producing isolated logging environments.
| Field Summary | |
|---|---|
static LogContextSelector |
DEFAULT_LOG_CONTEXT_SELECTOR
The default log context selector, which always returns the system log context. |
| Method Summary | ||
|---|---|---|
static LogContext |
create()
Create a new log context. |
|
void |
disableAccess()
Disable previous access to the object for modifications on the current thread. |
|
void |
enableAccess(Object protectKey)
Enable access to the object for modifications on the current thread. |
|
|
getAttachment(String loggerName,
Logger.AttachmentKey<V> key)
Get a logger attachment for a logger name, if it exists. |
|
Level |
getLevelForName(String name)
Get the level for a name. |
|
static LogContext |
getLogContext()
Get the currently active log context. |
|
Logger |
getLogger(String name)
Get a logger with the given name from this logging context. |
|
Logger |
getLoggerIfExists(String name)
Get a logger with the given name from this logging context, if a logger node exists at that location. |
|
LoggingMXBean |
getLoggingMXBean()
Get the LoggingMXBean associated with this log context. |
|
static LogContext |
getSystemLogContext()
Get the system log context. |
|
void |
protect(Object protectionKey)
Protect this object from modifications. |
|
void |
registerLevel(Level level)
Register a level instance with this log context. |
|
static void |
setLogContextSelector(LogContextSelector newSelector)
Set a new log context selector. |
|
void |
unprotect(Object protectionKey)
Allows the object to be modified if the protectionKey matches the key used to protect the object. |
|
void |
unregisterLevel(Level level)
Unregister a previously registered level. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final LogContextSelector DEFAULT_LOG_CONTEXT_SELECTOR
| Method Detail |
|---|
public static LogContext create()
"createLogContext"
RuntimePermission to invoke this method.
public Logger getLogger(String name)
name - the logger name
LogManager.getLogger(String)public Logger getLoggerIfExists(String name)
name - the logger name
null if no such logger node exists
public <V> V getAttachment(String loggerName,
Logger.AttachmentKey<V> key)
V - the attachment value typeloggerName - the logger namekey - the attachment key
null if the logger or the attachment does not existpublic LoggingMXBean getLoggingMXBean()
LoggingMXBean associated with this log context.
LoggingMXBean instance
public Level getLevelForName(String name)
throws IllegalArgumentException
name - the name
IllegalArgumentException - if the name is not knownpublic void registerLevel(Level level)
level - the level to registerpublic void unregisterLevel(Level level)
level - the level to unregisterpublic static LogContext getSystemLogContext()
public static LogContext getLogContext()
public static void setLogContextSelector(LogContextSelector newSelector)
"setLogContextSelector"
RuntimePermission to invoke this method.
newSelector - the new selector.
public void protect(Object protectionKey)
throws SecurityException
Protectable
protect in interface ProtectableprotectionKey - the key used to protect the object.
SecurityException - if the object is already protected.
public void unprotect(Object protectionKey)
throws SecurityException
ProtectableprotectionKey matches the key used to protect the object.
unprotect in interface ProtectableprotectionKey - the key used to protect the object.
SecurityException - if the object is protected and the key doesn't match.
public void enableAccess(Object protectKey)
throws SecurityException
Protectable
enableAccess in interface ProtectableprotectKey - the key used to protect modifications.
SecurityExceptionpublic void disableAccess()
Protectable
disableAccess in interface Protectable
|
JBoss Log Manager 1.4.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||