Class LoggerServiceImpl
- java.lang.Object
-
- org.craftercms.studio.impl.v2.service.log.LoggerServiceImpl
-
- All Implemented Interfaces:
LoggerService
public class LoggerServiceImpl extends Object implements LoggerService
Default implementation forLoggerService
.- Since:
- 4.0.2
- Author:
- jmendeza
-
-
Field Summary
Fields Modifier and Type Field Description protected LoggerService
loggerServiceInternal
-
Fields inherited from interface org.craftercms.studio.api.v2.service.log.LoggerService
VALID_LEVEL_PATTERN
-
-
Constructor Summary
Constructors Constructor Description LoggerServiceImpl(LoggerService loggerServiceInternal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Valid LoggerConfig
getLoggerConfig(String name, boolean createIfAbsent)
Get the logger with the given name and its configured priority levelList<LoggerConfig>
getLoggerConfigs()
Get all loggers and their configured priority levelsvoid
setLoggerLevel(String name, @NotEmpty String level, boolean createIfAbsent)
Updates a logger with a given name to have a given priority level-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.craftercms.studio.api.v2.service.log.LoggerService
getLoggerConfig
-
-
-
-
Field Detail
-
loggerServiceInternal
protected final LoggerService loggerServiceInternal
-
-
Constructor Detail
-
LoggerServiceImpl
@ConstructorProperties("loggerServiceInternal") public LoggerServiceImpl(LoggerService loggerServiceInternal)
-
-
Method Detail
-
getLoggerConfigs
public List<LoggerConfig> getLoggerConfigs() throws ServiceLayerException
Description copied from interface:LoggerService
Get all loggers and their configured priority levels- Specified by:
getLoggerConfigs
in interfaceLoggerService
- Returns:
- list of
LoggerConfig
- Throws:
ServiceLayerException
-
getLoggerConfig
@Valid public @Valid LoggerConfig getLoggerConfig(String name, boolean createIfAbsent) throws ServiceLayerException
Description copied from interface:LoggerService
Get the logger with the given name and its configured priority level- Specified by:
getLoggerConfig
in interfaceLoggerService
- 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
@Valid public void setLoggerLevel(String name, @NotEmpty @NotEmpty String level, boolean createIfAbsent) throws ServiceLayerException
Description copied from interface:LoggerService
Updates a logger with a given name to have a given priority level- Specified by:
setLoggerLevel
in interfaceLoggerService
- 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
-
-