use of ch.qos.logback.classic.Logger in project drill by apache.
the class LogFixture method setupConsole.
private void setupConsole(LogFixtureBuilder builder) {
drillLogger = (Logger) LoggerFactory.getLogger(DRILL_PACKAGE_NAME);
if (drillLogger.getAppender("STDOUT") != null) {
return;
}
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
ple = new PatternLayoutEncoder();
ple.setPattern(builder.consoleFormat);
ple.setContext(lc);
ple.start();
appender = new ConsoleAppender<>();
appender.setContext(lc);
appender.setName("Console");
appender.setEncoder(ple);
appender.start();
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.addAppender(appender);
drillLogger.addAppender(appender);
}
use of ch.qos.logback.classic.Logger in project verify-hub by alphagov.
the class NotOnOrAfterLoggerTest method setUp.
@Before
public void setUp() throws Exception {
final Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
logger.addAppender(mockAppender);
logger.setLevel(Level.INFO);
}
use of ch.qos.logback.classic.Logger in project verify-hub by alphagov.
the class UnknownMethodAlgorithmLoggerTest method tearDown.
@After
public void tearDown() throws Exception {
final Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
logger.detachAppender(mockAppender);
}
use of ch.qos.logback.classic.Logger in project springside4 by springside.
the class LogbackListAppender method removeFromRootLogger.
/**
* 将此appender从root logger中移除.
*/
public void removeFromRootLogger() {
Logger logger = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
logger.detachAppender(this);
}
use of ch.qos.logback.classic.Logger in project springside4 by springside.
the class LogbackListAppender method removeFromLogger.
/**
* 将此appender从logger中移除.
*/
public void removeFromLogger(String loggerName) {
Logger logger = (Logger) LoggerFactory.getLogger(loggerName);
logger.detachAppender(this);
}
Aggregations