Interface LoggerService
- All Known Implementing Classes:
Log4jLoggerServiceImpl
,LoggerServiceImpl
public interface LoggerService
Provides access to loggers configuration.
- Since:
- 4.0.2
- Author:
- jmendeza
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault LoggerConfig
getLoggerConfig
(String name) Get the logger with the given name.getLoggerConfig
(String name, boolean createIfAbsent) Get the logger with the given name and its configured priority levelGet all loggers and their configured priority levelsvoid
setLoggerLevel
(String name, String level, boolean createIfAbsent) Updates a logger with a given name to have a given priority level
-
Field Details
-
VALID_LEVEL_PATTERN
- See Also:
-
-
Method Details
-
getLoggerConfigs
Get all loggers and their configured priority levels- Returns:
- list of
LoggerConfig
- Throws:
ServiceLayerException
-
getLoggerConfig
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
Get the logger with the given name and its configured priority level- Parameters:
name
- logger namecreateIfAbsent
- 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
Updates a logger with a given name to have a given priority level- Parameters:
name
- logger namelevel
- the priority levelcreateIfAbsent
- 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
-