本文整理了Java中ch.qos.logback.core.Appender.clearAllFilters()
方法的一些代码示例,展示了Appender.clearAllFilters()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Appender.clearAllFilters()
方法的具体详情如下:
包路径:ch.qos.logback.core.Appender
类名称:Appender
方法名:clearAllFilters
暂无
代码示例来源:origin: ethereum/ethereumj
/**
* Allow only selected logger to print DEBUG events to STDOUT and FILE.
* Other loggers are allowed to print ERRORS only.
*/
private static void addSampleLogger(final String loggerName) {
if (CUSTOM_FILTER == null) {
CUSTOM_FILTER = new CustomFilter();
final LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
Appender ca = loggerContext.getLogger("ROOT").getAppender("STDOUT");
ca.clearAllFilters();
ca.addFilter(CUSTOM_FILTER);
}
CUSTOM_FILTER.addVisibleLogger(loggerName);
}
代码示例来源:origin: skylot/jadx
private boolean process(JCommanderWrapper jcw) {
if (printHelp) {
jcw.printUsage();
return false;
}
if (printVersion) {
System.out.println(JadxDecompiler.getVersion());
return false;
}
try {
if (threadsCount <= 0) {
throw new JadxException("Threads count must be positive, got: " + threadsCount);
}
if (verbose) {
ch.qos.logback.classic.Logger rootLogger =
(ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
// remove INFO ThresholdFilter
Appender<ILoggingEvent> appender = rootLogger.getAppender("STDOUT");
if (appender != null) {
appender.clearAllFilters();
}
}
} catch (JadxException e) {
System.err.println("ERROR: " + e.getMessage());
jcw.printUsage();
return false;
}
return true;
}
代码示例来源:origin: caskdata/cdap
@Override
public void clearAllFilters() {
delegate.clearAllFilters();
}
代码示例来源:origin: co.cask.cdap/cdap-watchdog
@Override
public void clearAllFilters() {
delegate.clearAllFilters();
}
代码示例来源:origin: apache/jackrabbit-oak
public void finished() {
if (thFilter==null) {
// then we did not add it
return;
}
List<Filter<ILoggingEvent>> filterList = appender.getCopyOfAttachedFiltersList();
appender.clearAllFilters();
for (Iterator<Filter<ILoggingEvent>> it = filterList.iterator(); it.hasNext();) {
Filter<ILoggingEvent> filter = it.next();
if (filter!=thFilter) {
appender.addFilter(filter);
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!