Interface LoggingMXBean


public interface LoggingMXBean
LoggingMXBean is the management interface for the logging sub-system.

The ObjectName for identifying the LoggingMXBean in a bean server is LogManager.LOGGING_MXBEAN_NAME.

Since:
1.5
  • Method Details

    • getLoggerLevel

      String getLoggerLevel​(String loggerName)
      Gets the string value of the logging level of a logger. An empty string is returned when the logger's level is defined by its parent. A null is returned if the specified logger does not exist.
      Parameters:
      loggerName - the name of the logger lookup.
      Returns:
      a String if the logger is found, otherwise null.
      See Also:
      Level.getName()
    • getLoggerNames

      List<String> getLoggerNames()
      Gets a list of all currently registered logger names. This is performed using the LogManager.getLoggerNames().
      Returns:
      a list of logger names.
    • getParentLoggerName

      String getParentLoggerName​(String loggerName)
      Gets the name of the parent logger of a logger. If the logger doesn't exist then null is returned. If the logger is the root logger, then an empty String is returned.
      Parameters:
      loggerName - the name of the logger to lookup.
      Returns:
      a String if the logger was found, otherwise null.
    • setLoggerLevel

      void setLoggerLevel​(String loggerName, String levelName)
      Sets the log level of a logger. LevelName set to null means the level is inherited from the nearest non-null ancestor.
      Parameters:
      loggerName - the name of the logger to set the level on, which must not be null.
      levelName - the level to set on the logger, which may be null.
      Throws:
      IllegalArgumentException - if loggerName is not a registered logger or if levelName is not null and not valid.
      See Also:
      Level.parse(String)