当前位置: 首页>>代码示例>>Java>>正文


Java TurboFilter类代码示例

本文整理汇总了Java中ch.qos.logback.classic.turbo.TurboFilter的典型用法代码示例。如果您正苦于以下问题:Java TurboFilter类的具体用法?Java TurboFilter怎么用?Java TurboFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TurboFilter类属于ch.qos.logback.classic.turbo包,在下文中一共展示了TurboFilter类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureLogbackScanPeriod

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
private static void configureLogbackScanPeriod(long millis)
{
    Logger l = LoggerFactory.getLogger(AggregationTest.class);
    ch.qos.logback.classic.Logger logbackLogger = (ch.qos.logback.classic.Logger) l;
    LoggerContext ctx = logbackLogger.getLoggerContext();
    TurboFilterList turboFilterList = ctx.getTurboFilterList();
    boolean done = false;
    for (TurboFilter turboFilter : turboFilterList)
    {
        if (turboFilter instanceof ReconfigureOnChangeFilter)
        {
            ReconfigureOnChangeFilter reconfigureFilter = (ReconfigureOnChangeFilter) turboFilter;
            reconfigureFilter.setRefreshPeriod(millis);
            reconfigureFilter.stop();
            reconfigureFilter.start(); // start() sets the next check timestammp
            done = true;
            break;
        }
    }
    assertTrue("ReconfigureOnChangeFilter not in logback's turbo-filter list - do that by adding scan=\"true\" to logback-test.xml's configuration element", done);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:22,代码来源:AggregationTest.java

示例2: addFilter

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@RequestMapping(value = "/1.0/admin/logging/logger/_add", method = RequestMethod.GET)
public @ResponseBody
Object addFilter(@NotEmpty(message = "You must specify a 'logger' param") @RequestParam(required = false) String logger,
                                      @RequestParam(required = false, defaultValue = "trace") String level)
{
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    for(TurboFilter filter : context.getTurboFilterList())
    {
        if(DynamicLoggerFilter.class.equals(filter.getClass()))
        {
            for(Logger l : context.getLoggerList())
            {
                if(l.getName().endsWith(logger))
                    ((DynamicLoggerFilter)filter).addOverride(l, level);
            }
            return ((DynamicLoggerFilter)filter).getRegisteredFilters();
        }
    }
    return "DynamicLoggerFilter not configured.  Please check logback.xml.";
}
 
开发者ID:CptnKirk,项目名称:spring-webmvc-dynamiclogging,代码行数:21,代码来源:LoggerFilterController.java

示例3: dropFilter

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@RequestMapping(value = "/1.0/admin/logging/logger/_drop", method = RequestMethod.GET)
public @ResponseBody
Object dropFilter(@NotEmpty(message = "You must specify a 'logger' param") @RequestParam(required = false) String logger)
{
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    for(TurboFilter filter : context.getTurboFilterList())
    {
        if(DynamicLoggerFilter.class.equals(filter.getClass()))
        {
            for(Logger l : context.getLoggerList())
            {
                if(l.getName().equals(logger))
                    ((DynamicLoggerFilter)filter).dropOverride(l);
            }
            return ((DynamicLoggerFilter)filter).getRegisteredFilters();
        }
    }
    return "DynamicLoggerFilter not configured.  Please check logback.xml.";
}
 
开发者ID:CptnKirk,项目名称:spring-webmvc-dynamiclogging,代码行数:20,代码来源:LoggerFilterController.java

示例4: resetTurboFilterList

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
public void resetTurboFilterList() {
    Iterator i$ = this.turboFilterList.iterator();

    while(i$.hasNext()) {
        TurboFilter tf = (TurboFilter)i$.next();
        tf.stop();
    }

    this.turboFilterList.clear();
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:11,代码来源:KonkerLoggerContext.java

示例5: handleContextRefresh

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@EventListener
public void handleContextRefresh(final ContextRefreshedEvent event) {
	final LoggerContext loggerContext = ((Logger) LoggerFactory.getLogger("")).getLoggerContext();
	loggerContext.addTurboFilter(new TurboFilter() {
		@Override
		public FilterReply decide(final Marker marker, final Logger logger, final Level level, final String format,
				final Object[] params, final Throwable t) {
			return TraceThreadLoggingSupport.isTraceActive() ? FilterReply.ACCEPT : FilterReply.NEUTRAL;
		}
	});
	LOGGER.info("ThreadLogging support initialized");
}
 
开发者ID:JanLoebel,项目名称:uaa-service,代码行数:13,代码来源:TraceThreadLoggingInitializer.java

示例6: resetTurboFilterList

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
/**
 * First processPriorToRemoval all registered turbo filters and then clear the registration
 * list.
 */
public void resetTurboFilterList() {
  for (TurboFilter tf : turboFilterList) {
    tf.stop();
  }
  turboFilterList.clear();
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:11,代码来源:LoggerContext.java

示例7: turboFilter

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@Test
public void turboFilter() throws JoranException {
  // Although this test uses turbo filters, it only checks
  // that Joran can see the xml element and create
  // and place the relevant object correctly.
  configure(ClassicTestConstants.JORAN_INPUT_PREFIX + "turbo.xml");

  TurboFilter filter = loggerContext.getTurboFilterList().get(0);
  assertTrue(filter instanceof NOPTurboFilter);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:11,代码来源:JoranConfiguratorTest.java

示例8: testTurboFilterWithStringList

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@Test
public void testTurboFilterWithStringList() throws JoranException {
  // Although this test uses turbo filters, it only checks
  // that Joran can see <user> elements, and behave correctly
  // that is call the addUser method and pass the correct values
  // to that method.
  configure(ClassicTestConstants.JORAN_INPUT_PREFIX + "turbo2.xml");

  // StatusPrinter.print(loggerContext.getStatusManager());

  TurboFilter filter = loggerContext.getTurboFilterList().get(0);
  assertTrue(filter instanceof DebugUsersTurboFilter);
  DebugUsersTurboFilter dutf = (DebugUsersTurboFilter) filter;
  assertEquals(2, dutf.getUsers().size());
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:16,代码来源:JoranConfiguratorTest.java

示例9: getFilters

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@RequestMapping(value = "/1.0/admin/logging/mdc", method = RequestMethod.GET)
public @ResponseBody
Object getFilters()
{
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    for (TurboFilter filter : context.getTurboFilterList())
    {
        if (DynamicMDCFilter.class.equals(filter.getClass()))
        {
            return ((DynamicMDCFilter) filter).getRegisteredFilters();
        }
    }
    return "DynamicMDCFilter not configured.  Please check logback.xml.";
}
 
开发者ID:CptnKirk,项目名称:spring-webmvc-dynamiclogging,代码行数:15,代码来源:MDCFilterController.java

示例10: dropAllFilter

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@RequestMapping(value = "/1.0/admin/logging/mdc/_dropAll", method = RequestMethod.GET)
public @ResponseBody
Object dropAllFilter()
{
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    for(TurboFilter filter : context.getTurboFilterList())
    {
        if(DynamicMDCFilter.class.equals(filter.getClass()))
        {
            ((DynamicMDCFilter)filter).clear();
            return ((DynamicMDCFilter)filter).getRegisteredFilters();
        }
    }
    return "DynamicMDCFilter not configured.  Please check logback.xml.";
}
 
开发者ID:CptnKirk,项目名称:spring-webmvc-dynamiclogging,代码行数:16,代码来源:MDCFilterController.java

示例11: getFilters

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@RequestMapping(value = "/1.0/admin/logging/logger", method = RequestMethod.GET)
public @ResponseBody
Object getFilters()
{
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    for (TurboFilter filter : context.getTurboFilterList())
    {
        if (DynamicLoggerFilter.class.equals(filter.getClass()))
        {
            return ((DynamicLoggerFilter) filter).getRegisteredFilters();
        }
    }
    return "DynamicLoggerFilter not configured.  Please check logback.xml.";
}
 
开发者ID:CptnKirk,项目名称:spring-webmvc-dynamiclogging,代码行数:15,代码来源:LoggerFilterController.java

示例12: dropAllFilter

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
@RequestMapping(value = "/1.0/admin/logging/logger/_dropAll", method = RequestMethod.GET)
public @ResponseBody
Object dropAllFilter()
{
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    for(TurboFilter filter : context.getTurboFilterList())
    {
        if(DynamicLoggerFilter.class.equals(filter.getClass()))
        {
            ((DynamicLoggerFilter)filter).clear();
            return ((DynamicLoggerFilter)filter).getRegisteredFilters();
        }
    }
    return "DynamicLoggerFilter not configured.  Please check logback.xml.";
}
 
开发者ID:CptnKirk,项目名称:spring-webmvc-dynamiclogging,代码行数:16,代码来源:LoggerFilterController.java

示例13: addTurboFilter

import ch.qos.logback.classic.turbo.TurboFilter; //导入依赖的package包/类
public void addTurboFilter(TurboFilter newFilter) {
  turboFilterList.add(newFilter);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:4,代码来源:LoggerContext.java


注:本文中的ch.qos.logback.classic.turbo.TurboFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。