Class Log4jLoggerServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.log.internal.Log4jLoggerServiceImpl
- All Implemented Interfaces:
LoggerService
Log4j implementation for
LoggerService.- Since:
- 4.0.2
- Author:
- jmendeza
-
Field Summary
Fields inherited from interface org.craftercms.studio.api.v2.service.log.LoggerService
VALID_LEVEL_PATTERN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLoggerConfig(String name, boolean createIfAbsent) Get the logger with the given name and its configured priority levelGet all loggers and their configured priority levelsvoidsetLoggerLevel(String name, String level, boolean createIfAbsent) Updates a logger with a given name to have a given priority levelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.craftercms.studio.api.v2.service.log.LoggerService
getLoggerConfig
-
Constructor Details
-
Log4jLoggerServiceImpl
public Log4jLoggerServiceImpl()
-
-
Method Details
-
getLoggerConfigs
Description copied from interface:LoggerServiceGet all loggers and their configured priority levels- Specified by:
getLoggerConfigsin interfaceLoggerService- Returns:
- list of
LoggerConfig
-
getLoggerConfig
public LoggerConfig getLoggerConfig(String name, boolean createIfAbsent) throws ServiceLayerException Description copied from interface:LoggerServiceGet the logger with the given name and its configured priority level- Specified by:
getLoggerConfigin 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
LoggerConfigobject - Throws:
ServiceLayerException
-
setLoggerLevel
public void setLoggerLevel(String name, String level, boolean createIfAbsent) throws ServiceLayerException Description copied from interface:LoggerServiceUpdates a logger with a given name to have a given priority level- Specified by:
setLoggerLevelin 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
-