Interface LoggerService

All Known Implementing Classes:
Log4jLoggerServiceImpl, LoggerServiceImpl

public interface LoggerService
Provides access to loggers configuration.
Since:
4.0.2
Author:
jmendeza
  • Field Details

  • Method Details

    • getLoggerConfigs

      List<LoggerConfig> getLoggerConfigs() throws ServiceLayerException
      Get all loggers and their configured priority levels
      Returns:
      list of LoggerConfig
      Throws:
      ServiceLayerException
    • getLoggerConfig

      default LoggerConfig getLoggerConfig(String name) throws ServiceLayerException
      Get the logger with the given name. The logger will be created in case it does not exist
      Parameters:
      name - logger name
      Returns:
      a LoggerConfig object
      Throws:
      ServiceLayerException
    • getLoggerConfig

      LoggerConfig getLoggerConfig(String name, boolean createIfAbsent) throws ServiceLayerException
      Get the logger with the given name and its configured priority level
      Parameters:
      name - logger name
      createIfAbsent - if true, the logger will be created in case it does not exist yet if false, a LoggerNotFoundException will be thrown if logger is not in the registry
      Returns:
      a LoggerConfig object
      Throws:
      ServiceLayerException
    • setLoggerLevel

      void setLoggerLevel(String name, String level, boolean createIfAbsent) throws ServiceLayerException
      Updates a logger with a given name to have a given priority level
      Parameters:
      name - logger name
      level - the priority level
      createIfAbsent - if true, the logger will be created in case it does not exist yet if false, a LoggerNotFoundException will be thrown if logger is not in the registry
      Throws:
      ServiceLayerException