Skip to content

Most visited

Recently visited

navigation
Added in API level 1

LoggingMXBean

public interface LoggingMXBean

java.util.logging.LoggingMXBean


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

getLoggerLevel

Added in API level 1
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 String: the name of the logger lookup.
Returns
String a String if the logger is found, otherwise null.

See also:

getLoggerNames

Added in API level 1
List<String> getLoggerNames ()

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

Returns
List<String> a list of logger names.

getParentLoggerName

Added in API level 1
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 String: the name of the logger to lookup.
Returns
String a String if the logger was found, otherwise null.

setLoggerLevel

Added in API level 1
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 String: the name of the logger to set the level on, which must not be null.
levelName String: 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:

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.