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


Java FilterReply.NEUTRAL属性代码示例

本文整理汇总了Java中ch.qos.logback.core.spi.FilterReply.NEUTRAL属性的典型用法代码示例。如果您正苦于以下问题:Java FilterReply.NEUTRAL属性的具体用法?Java FilterReply.NEUTRAL怎么用?Java FilterReply.NEUTRAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在ch.qos.logback.core.spi.FilterReply的用法示例。


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

示例1: decide

@Override
public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t)
{
    //System.out.println("** Being called "+logger+"**"+level+"**"+marker);
    ConfigValueTuple override = loggerOverrides.get(logger);
    if(override != null)
    {
        Level configLevel = Level.toLevel(override.getLevel());
        if(level.isGreaterOrEqual(configLevel))
            return FilterReply.ACCEPT;
        else
            return FilterReply.DENY;
    }
    else
        return FilterReply.NEUTRAL;
}
 
开发者ID:CptnKirk,项目名称:spring-webmvc-dynamiclogging,代码行数:16,代码来源:DynamicLoggerFilter.java

示例2: decide

@Override
public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t) {
    // cannot use logger.isEnabledFor(level), as it would cause a StackOverflowError by calling this filter again!
    if(level.isGreaterOrEqual(logger.getEffectiveLevel()) && format != null) {
        switch (level.toInt()) {
            case Level.ERROR_INT:
                errorCounter.increment();
                break;
            case Level.WARN_INT:
                warnCounter.increment();
                break;
            case Level.INFO_INT:
                infoCounter.increment();
                break;
            case Level.DEBUG_INT:
                debugCounter.increment();
                break;
            case Level.TRACE_INT:
                traceCounter.increment();
                break;
        }
    }

    return FilterReply.NEUTRAL;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:25,代码来源:LogbackMetrics.java

示例3: decide

@Override
public FilterReply decide(ILoggingEvent event) {
    if (event.getFormattedMessage().contains("Received 404 error, please notify the developer and include the URL ("))
        return FilterReply.DENY;
    if (event.getMarker() != Markers.NO_ANNOUNCE && Launcher.getInstance().getClient().isReady() && event.getLevel() == Level.ERROR) {
        String msg = event.getFormattedMessage();

        if (event.getThrowableProxy() != null && event.getThrowableProxy() instanceof ThrowableProxy) {
            @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
            Throwable throwable = ((ThrowableProxy) event.getThrowableProxy()).getThrowable();
            if (throwable != null) {
                msg += ' ';
                StringWriter sw = new StringWriter();
                PrintWriter pw = new PrintWriter(sw);
                throwable.printStackTrace(pw);
                msg += sw.toString();
                pw.close();
            }
        }
        Messages.send(msg, Launcher.getInstance().getClient().getChannelByID("233632081110892546"));
    }
    return FilterReply.NEUTRAL;
}
 
开发者ID:ArsenArsen,项目名称:ABot,代码行数:23,代码来源:ErrorInterceptor.java

示例4: decide

@Override
public FilterReply decide(E eventObject) {
    if (!isStarted()) {
        return FilterReply.NEUTRAL;
    }

    LoggingEvent event = (LoggingEvent) eventObject;

    if (this.levelMin != null && !event.getLevel().isGreaterOrEqual(levelMin)) {
        return DENY;
    }

    if (this.levelMax != null && event.getLevel().toInt() > levelMax.toInt()) {
        return DENY;
    }

    if (acceptOnMatch) {
        return ACCEPT;
    } else {
        return NEUTRAL;
    }
}
 
开发者ID:Transkribus,项目名称:TranskribusCore,代码行数:22,代码来源:LevelRangeFilter.java

示例5: filterAndLog_0_Or3Plus

/**
 * The next methods are not merged into one because of the time we gain by not
 * creating a new Object[] with the params. This reduces the cost of not
 * logging by about 20 nanoseconds.
 */

private void filterAndLog_0_Or3Plus(final String localFQCN,
    final Marker marker, final Level level, final String msg,
    final Object[] params, final Throwable t) {

  final FilterReply decision = loggerContext
      .getTurboFilterChainDecision_0_3OrMore(marker, this, level, msg,
          params, t);

  if (decision == FilterReply.NEUTRAL) {
    if (effectiveLevelInt > level.levelInt) {
      return;
    }
  } else if (decision == FilterReply.DENY) {
    return;
  }

  buildLoggingEventAndAppend(localFQCN, marker, level, msg, params, t);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:24,代码来源:Logger.java

示例6: filterAndLog_1

private void filterAndLog_1(final String localFQCN,
    final Marker marker, final Level level, final String msg,
    final Object param, final Throwable t) {

  final FilterReply decision = loggerContext.getTurboFilterChainDecision_1(
      marker, this, level, msg, param, t);

  if (decision == FilterReply.NEUTRAL) {
    if (effectiveLevelInt > level.levelInt) {
      return;
    }
  } else if (decision == FilterReply.DENY) {
    return;
  }

  buildLoggingEventAndAppend(localFQCN, marker, level, msg,
      new Object[] { param }, t);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:18,代码来源:Logger.java

示例7: filterAndLog_2

private void filterAndLog_2(final String localFQCN,
    final Marker marker, final Level level, final String msg,
    final Object param1, final Object param2, final Throwable t) {

  final FilterReply decision = loggerContext.getTurboFilterChainDecision_2(
      marker, this, level, msg, param1, param2, t);

  if (decision == FilterReply.NEUTRAL) {
    if (effectiveLevelInt > level.levelInt) {
      return;
    }
  } else if (decision == FilterReply.DENY) {
    return;
  }

  buildLoggingEventAndAppend(localFQCN, marker, level, msg, new Object[] {
      param1, param2 }, t);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:18,代码来源:Logger.java

示例8: decide

/**
 * This method first finds the MDC value for 'key'. It then finds the level
 * threshold associated with this MDC value from the list of MDCValueLevelPair
 * passed to this filter. This value is stored in a variable called
 * 'levelAssociatedWithMDCValue'. If it null, then it is set to the
 * 
 * @{link #defaultThreshold} value.
 * 
 * If no such value exists, then
 * 
 * 
 * @param marker
 * @param logger
 * @param level
 * @param s
 * @param objects
 * @param throwable
 * 
 * @return FilterReply - this filter's decision
 */
@Override
public FilterReply decide(Marker marker, Logger logger, Level level,
    String s, Object[] objects, Throwable throwable) {

  String mdcValue = MDC.get(this.key);
  if (!isStarted()) {
    return FilterReply.NEUTRAL;
  }

  Level levelAssociatedWithMDCValue = null;
  if (mdcValue != null) {
    levelAssociatedWithMDCValue = valueLevelMap.get(mdcValue);
  }
  if (levelAssociatedWithMDCValue == null) {
    levelAssociatedWithMDCValue = defaultThreshold;
  }
  if (level.isGreaterOrEqual(levelAssociatedWithMDCValue)) {
    return onHigherOrEqual;
  } else {
    return onLower;
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:42,代码来源:DynamicThresholdFilter.java

示例9: decide

@Override
public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t) {
  if(!isStarted()) {
    return FilterReply.NEUTRAL;
  }
  
  if(marker == null) {
    return onMismatch;
  } 
  
  if(marker.contains(markerToMatch)) {
    return onMatch;
  } else {
    return onMismatch;
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:16,代码来源:MarkerFilter.java

示例10: decide

@Override
public FilterReply decide(Object event)
{
    if (!isStarted())
    {
        return FilterReply.NEUTRAL;
    }

    LoggingEvent loggingEvent = (LoggingEvent) event;

    List<Level> eventsToKeep = Arrays.asList(Level.TRACE, Level.DEBUG, Level.INFO);
    if (eventsToKeep.contains(loggingEvent.getLevel()))
    {
        return FilterReply.NEUTRAL;
    }
    else
    {
        return FilterReply.DENY;
    }
}
 
开发者ID:krux,项目名称:java-stdlib,代码行数:20,代码来源:StdOutFilter.java

示例11: decide

@Override
public FilterReply decide(Object event)
{
    if (!isStarted())
    {
        return FilterReply.NEUTRAL;
    }

    LoggingEvent loggingEvent = (LoggingEvent) event;

    List<Level> eventsToKeep = Arrays.asList( Level.WARN, Level.ERROR );
    if (eventsToKeep.contains(loggingEvent.getLevel()))
    {
        return FilterReply.NEUTRAL;
    }
    else
    {
        return FilterReply.DENY;
    }
}
 
开发者ID:krux,项目名称:java-stdlib,代码行数:20,代码来源:ErrOutFilter.java

示例12: decide

@Override
public FilterReply decide(ILoggingEvent event) {
    if(!isStarted())
        return FilterReply.NEUTRAL;

    if(logger != null && !event.getLoggerName().startsWith(logger))
        return FilterReply.NEUTRAL;

    if(exceptLogger != null && event.getLoggerName().startsWith(exceptLogger))
        return FilterReply.NEUTRAL;

    if(level != null && !event.getLevel().isGreaterOrEqual(level))
        return FilterReply.DENY;

    return FilterReply.NEUTRAL;
}
 
开发者ID:spotify,项目名称:logging-java,代码行数:16,代码来源:LoggerThresholdFilter.java

示例13: decide

@Override
public FilterReply decide(final ILoggingEvent event) {
  if (!isStarted()) {
    return FilterReply.NEUTRAL;
  }

  if (levelMin != null && event.getLevel().levelInt < levelMin.levelInt) {
    return FilterReply.DENY;
  }

  if (levelMax != null && event.getLevel().levelInt > levelMax.levelInt) {
    return FilterReply.DENY;
  }

  return FilterReply.NEUTRAL;
}
 
开发者ID:spotify,项目名称:logging-java,代码行数:16,代码来源:LevelRangeFilter.java

示例14: decide

@Override
public FilterReply decide(final ILoggingEvent event) {
    final Marker marker = event.getMarker();
    if (!isStarted()) {
        return FilterReply.NEUTRAL;
    }

    if (marker == null) {
        return onMismatch;
    }

    if (markerToMatch.contains(marker)) {
        return onMatch;
    }
    return onMismatch;
}
 
开发者ID:danielferber,项目名称:git-to-clearcase,代码行数:16,代码来源:MarkerFilter.java

示例15: decide

@Override
public FilterReply decide(ILoggingEvent e) {
	
	if(!evicting.isAlive()){
		log.info("Starting up thread {}.", evicting.getName());
		evicting.start();
	}

	String message = e.getFormattedMessage();
	long timestamp = e.getTimeStamp();
	Long lastTimestamp = cache.timestampOfLastOccurence(message);

	cache.put(message, timestamp);
	
	FilterReply result;
	if (lastTimestamp != null) {
		long deltaFromLastOccurence = timestamp - lastTimestamp;
		result = (deltaFromLastOccurence > maxAgeInMillis) ? FilterReply.NEUTRAL
				: FilterReply.DENY;
	} else {
		result = FilterReply.NEUTRAL;
	}

	return result;

}
 
开发者ID:danidemi,项目名称:jlubricant,代码行数:26,代码来源:DenyDuplicationsFilter.java


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