Interface PlatformLoggingMXBean

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 MXBean can be done in one of three ways.

  1. Invoking the static ManagementFactory.getPlatformMXBean(java.lang.Class<T>) method.
  2. Using a javax.management.MBeanServerConnection.
  3. 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 Details

    • getLoggerLevel

      String getLoggerLevel(String loggerName)
      Returns the string name of the specified Logger instance's current log level.
      Parameters:
      loggerName - the name of a particular Logger instance
      Returns:
      if loggerName resolves to an existing registered Logger instance, the log level of that instance. Note that if it is the case that the Logger just inherits its log level rather than specifying its own, then an empty string ("") will be returned. If loggerName does not resolve to a registered instance of Logger then a null value is returned.
    • getLoggerNames

      List<String> getLoggerNames()
      Returns a list of the names of all of the currently registered Logger instances.
      Returns:
      a list of the names of all registered Logger objects.
    • getParentLoggerName

      String getParentLoggerName(String loggerName)
      Returns the name of the parent Logger of the specified registered Logger,loggerName.
      Parameters:
      loggerName - the name of a particular Logger instance
      Returns:
      if loggerName resolves to an existing registered Logger instance, the name of its parent Logger. If the Logger is the root entry in the Logger hierarchy, then an empty string ("") will be returned. If loggerName does not resolve to a registered instance of Logger then a null value is returned.
    • setLoggerLevel

      void setLoggerLevel(String loggerName, String levelName)
      Attempts to update the log level of the Logger with name loggerName to levelName.

      If levelName is null then the Logger instance's log level is set to be null with the result that it will inherit its log level from its nearest parent which does not have a null log level value.

      Parameters:
      loggerName - the name of a registered Logger
      levelName - the name of the new log level. May be null, in which case loggerName will inherit the log level of its closest parent with a non-null log level.
      Throws:
      IllegalArgumentException - if there is no Logger with the name loggerName. Also may be thrown if loggerName is not a known log level name.
      SecurityException - if there is a security manager active and the caller does not have LoggingPermission of "control".