There is a single global instance of the PlatformLoggingMXBean.
The ManagementFactory. method can be used to obtain
the PlatformLoggingMXBean object as follows:
PlatformLoggingMXBean logging = ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class);
The PlatformLoggingMXBean object is also registered with the
platform MBeanServer.
The ObjectName for uniquely
identifying the PlatformLoggingMXBean within an MBeanServer is:
java.util.logging:type=Logging
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: The name of the log level of the specified logger; or an empty string if the log level of the specified logger isnull. If the specified logger does not
exist, null is returned.The name of the loggerName)Logger to be retrieved.Gets the name of the log level associated with the specified logger. |
| public List | Returns: A list ofString each of which is a
currently registered Logger name.Returns the list of the currently registered logger names. |
| public String | Returns: the name of the nearest existing parent logger; an empty string if the specified logger is the root logger. If the specified logger does not exist,null
is returned.The name of a loggerName)Logger.Returns the name of the parent for the specified logger. |
| public void | setLoggerLevel(String
The name of the loggerName, String Logger to be set.
Must be non-null.The name of the level to set on the specified logger,
or levelName)null if setting the level to inherit
from its nearest ancestor.Sets the specified logger to the specified new level. |
| getLoggerLevel | back to summary |
|---|---|
| public String getLoggerLevel(String loggerName) Gets the name of the log level associated with the specified logger.
If the specified logger does not exist,
If the
| |
| getLoggerNames | back to summary |
|---|---|
| public List Returns the list of the currently registered
logger names. This method
calls | |
| getParentLoggerName | back to summary |
|---|---|
| public String getParentLoggerName(String loggerName) Returns the name of the
parent
for the specified logger.
If the specified logger does not exist, | |
| setLoggerLevel | back to summary |
|---|---|
| public void setLoggerLevel(String loggerName, String levelName) Sets the specified logger to the specified new
level.
If the
| |