public final class LoggingFacade extends Object
Modifier and Type | Field and Description |
---|---|
private String |
logFormatThreadMsg |
private ch.qos.logback.classic.LoggerContext |
loggerContext |
private ch.qos.logback.classic.Logger |
rootLogger |
Constructor and Description |
---|
LoggingFacade()
Create the logging facade, by default adding a console logger to output logging info to the screen (console).
|
Modifier and Type | Method and Description |
---|---|
void |
addConsoleLogger(String level,
String pattern)
Add a console logger to the list of loggers of the project.
|
void |
addFileLogger(String file,
String level,
String pattern,
Boolean overwrite)
Add a file logger to the list of loggers of the project.
|
private ch.qos.logback.core.encoder.Encoder<ch.qos.logback.classic.spi.ILoggingEvent> |
createPatternLayoutEncoder(String pattern)
Create a pattern layout encoder for a given pattern.
|
private ch.qos.logback.core.filter.Filter<ch.qos.logback.classic.spi.ILoggingEvent> |
createThresholdFilter(String level)
Create a thresholdFilter for a given level.
|
private void |
setLoggingLevel(String level)
Convert the string passed as argument to a Level.
|
private ch.qos.logback.classic.Logger rootLogger
private ch.qos.logback.classic.LoggerContext loggerContext
private String logFormatThreadMsg
public LoggingFacade()
public void addConsoleLogger(String level, String pattern)
level
- the logging level to be applied.pattern
- the pattern for the logger.public void addFileLogger(String file, String level, String pattern, Boolean overwrite)
file
- the name of the file to which the logging messages will be added.level
- the logging level to be applied.pattern
- the pattern for the logger.overwrite
- if true, the contents of any previous log are overwritten. If false, the logs are appended.private ch.qos.logback.core.encoder.Encoder<ch.qos.logback.classic.spi.ILoggingEvent> createPatternLayoutEncoder(String pattern)
pattern
- the pattern to apply.private ch.qos.logback.core.filter.Filter<ch.qos.logback.classic.spi.ILoggingEvent> createThresholdFilter(String level)
level
- the level to set.private void setLoggingLevel(String level)
level
- the logging level that should be used.Copyright © 2015 University of Glasgow. All rights reserved.