public interface

LoggingService

com.atlassian.bitbucket.log.LoggingService

Class Overview

Service that allows runtime configuration of the logging subsystem.

Summary

Public Methods
@Nonnull String getLevel(String loggerName)
Retrieves the effective logging level of the specified logger.
@Nonnull String getRootLevel()
void setLevel(String loggerName, String level)
Sets the level for the specified logger to the provided level.
void setRootLevel(String level)
Sets the output level for the root logger, which is a special logger that is the ultimate parent of all other loggers in the system.

Public Methods

@Nonnull public String getLevel (String loggerName)

Retrieves the effective logging level of the specified logger. The effective logging level is level that is defined for the specified logger or, if no level is defined for the specified logger, the effective level for its parent logger.

Parameters
loggerName the name of the logger to retrieve the output level for
Returns
  • the effective logging level of the specified logger

@Nonnull public String getRootLevel ()

Returns
  • the effective logging level for the root logger, which is the ultimate parent of all loggers in the system

public void setLevel (String loggerName, String level)

Sets the level for the specified logger to the provided level. Valid levels are:

  • OFF
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
The special level OFF disables all output from the specified logger. All other levels include output at that specific level as well as all output from the levels below them (meaning TRACE will include output at DEBUG, INFO, WARN and ERROR levels).

Parameters
loggerName the name of the logger to adjust the output level for
level the new output level for the logger

public void setRootLevel (String level)

Sets the output level for the root logger, which is a special logger that is the ultimate parent of all other loggers in the system.

Parameters
level the new output level for the root logger