-
- All Superinterfaces:
PlatformManagedObject
public interface PlatformLoggingMXBean extends PlatformManagedObject
The management interface for the logging facility.Precisely one instance of this interface will be made available to management clients.
Accessing this
MXBeancan be done in one of three ways.- Invoking the static
ManagementFactory.getPlatformMXBean(java.lang.Class<T>)method. - Using a javax.management.MBeanServerConnection.
- Obtaining a proxy MXBean from the static
ManagementFactory.newPlatformMXBeanProxy(javax.management.MBeanServerConnection, java.lang.String, java.lang.Class<T>)method, passing in "java.util.logging:type=Logging" for the value of the second parameter.
- Since:
- 1.5
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetLoggerLevel(String loggerName)Returns the string name of the specifiedLoggerinstance's current log level.List<String>getLoggerNames()Returns a list of the names of all of the currently registeredLoggerinstances.StringgetParentLoggerName(String loggerName)voidsetLoggerLevel(String loggerName, String levelName)-
Methods declared in interface java.lang.management.PlatformManagedObject
getObjectName
-
-
-
-
Method Detail
-
getLoggerLevel
String getLoggerLevel(String loggerName)
Returns the string name of the specifiedLoggerinstance's current log level.- Parameters:
loggerName- the name of a particularLoggerinstance- Returns:
- if
loggerNameresolves to an existing registeredLoggerinstance, the log level of that instance. Note that if it is the case that theLoggerjust inherits its log level rather than specifying its own, then an empty string ("") will be returned. IfloggerNamedoes not resolve to a registered instance ofLoggerthen anullvalue is returned.
-
getLoggerNames
List<String> getLoggerNames()
Returns a list of the names of all of the currently registeredLoggerinstances.- Returns:
- a list of the names of all registered
Loggerobjects.
-
getParentLoggerName
String getParentLoggerName(String loggerName)
- Parameters:
loggerName- the name of a particularLoggerinstance- Returns:
- if
loggerNameresolves to an existing registeredLoggerinstance, the name of its parentLogger. If theLoggeris the root entry in theLoggerhierarchy, then an empty string ("") will be returned. IfloggerNamedoes not resolve to a registered instance ofLoggerthen anullvalue is returned.
-
setLoggerLevel
void setLoggerLevel(String loggerName, String levelName)
Attempts to update the log level of theLoggerwith nameloggerNametolevelName.If
levelNameisnullthen theLoggerinstance's log level is set to benullwith the result that it will inherit its log level from its nearest parent which does not have anulllog level value.- Parameters:
loggerName- the name of a registeredLoggerlevelName- the name of the new log level. May benull, in which caseloggerNamewill inherit the log level of its closest parent with a non-nulllog level.- Throws:
IllegalArgumentException- if there is noLoggerwith the nameloggerName. Also may be thrown ifloggerNameis not a known log level name.SecurityException- if there is a security manager active and the caller does not haveLoggingPermissionof "control".
-
-