- All Known Implementing Classes:
JulProxy,Log4jProxy,LogbackProxy
public interface LoggerProxy
A logging proxy facilitating the setting of log levels
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LoggerProxyThe no-op logger proxy instance, zero functionality. -
Method Summary
Modifier and TypeMethodDescriptiondefault Collection<String> files()static LoggerProxyinstance()Returns the level set for the given logger itself, null where it has none, the logger then inheriting the level of its nearest ancestor with one.voidSets the level of the given loggerlevels()loggers()root()
-
Field Details
-
NONE
The no-op logger proxy instance, zero functionality.
-
-
Method Details
-
level
Returns the level set for the given logger itself, null where it has none, the logger then inheriting the level of its nearest ancestor with one. Theroot()logger always has a level.- Parameters:
logger- the logger name- Returns:
- the level set for the given logger, null if none is set
-
level
Sets the level of the given logger- Parameters:
logger- the logger namelevel- the level, one oflevels()- Throws:
IllegalArgumentException- in case the level is not of the type oflevels()
-
levels
- Returns:
- the available log levels, ordered from the most to the least verbose, OFF last
-
root
String root()- Returns:
- the name of the root logger
-
loggers
Collection<String> loggers()- Returns:
- all loggers
-
files
- Returns:
- the log file paths, if available
-
instance
- Returns:
- the first available LoggerProxy implementation found,
NONEif none is available.
-