Since: API Level 1
public interface

LoggingMXBean

java.util.logging.LoggingMXBean

Class Overview

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

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

Summary

Public Methods
abstract String getLoggerLevel(String loggerName)
Gets the string value of the logging level of a logger.
abstract List<String> getLoggerNames()
Gets a list of all currently registered logger names.
abstract String getParentLoggerName(String loggerName)
Gets the name of the parent logger of a logger.
abstract void setLoggerLevel(String loggerName, String levelName)
Sets the log level of a logger.

Public Methods

public abstract String getLoggerLevel (String loggerName)

Since: API Level 1

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

public abstract List<String> getLoggerNames ()

Since: API Level 1

Gets a list of all currently registered logger names. This is performed using the getLoggerNames().

Returns
  • a list of logger names.

public abstract String getParentLoggerName (String loggerName)

Since: API Level 1

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.

public abstract void setLoggerLevel (String loggerName, String levelName)

Since: API Level 1

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