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


Java FilterReply.DENY属性代码示例

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


在下文中一共展示了FilterReply.DENY属性的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: postInvoke

@Override
public void postInvoke(Request request, Response response)
        throws IOException, ServletException {
    final HttpServletRequest httpRequest = (HttpServletRequest) request.getRequest();
    try {
        CatalinaAdapter adapter = new CatalinaAdapter(request, response);
        IAccessEvent accessEvent = new AccessEvent(httpRequest, (HttpServletResponse) response.getResponse(),
            adapter);

        if (ctx.getFilterChainDecision(accessEvent) == FilterReply.DENY) {
            return;
        }

        // TODO better tion handling
        ctx.callAppenders(accessEvent);
    } finally {
        httpRequest.removeAttribute(AccessConstants.LOGBACK_STATUS_MANAGER_KEY);
    }
}
 
开发者ID:goodees,项目名称:goodees,代码行数:19,代码来源:CatalinaValve.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(ILoggingEvent event) {
    String msg = event.getFormattedMessage();
    if (msg.startsWith("Received 40")) {
        return FilterReply.DENY;
    }
    if (msg.startsWith("Attempt to send message on closed")) {
        return FilterReply.DENY;
    }
    if (event.getMarker() != Markers.NO_ANNOUNCE
            && FlareBot.getInstance().getClient() != null
            && FlareBot.getInstance().getClient().isReady()
            && event.getLevel() == Level.ERROR) {
        EXECUTOR.submit(() -> {
            Throwable throwable = null;
            if (event.getThrowableProxy() != null && event.getThrowableProxy() instanceof ThrowableProxy) {
                throwable = ((ThrowableProxy) event.getThrowableProxy()).getThrowable();
            }
            if (throwable != null) {
                MessageUtils.sendException(msg, throwable, FlareBot.getInstance().getUpdateChannel());
            } else MessageUtils.sendMessage(msg, FlareBot.getInstance().getUpdateChannel());
        });
    }
    return FilterReply.NEUTRAL;
}
 
开发者ID:ArsenArsen,项目名称:FlareBot,代码行数:25,代码来源:ErrorCatcher.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_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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: decide

@Override
public FilterReply decide(ILoggingEvent event) {
	final IThrowableProxy throwableProxy = event.getThrowableProxy();
	if (throwableProxy == null) {
		return FilterReply.NEUTRAL;
	}

	if (!(throwableProxy instanceof ThrowableProxy)) {
		return FilterReply.NEUTRAL;
	}

	final ThrowableProxy throwableProxyImpl = (ThrowableProxy) throwableProxy;
	final Throwable throwable = throwableProxyImpl.getThrowable();
	if (java.nio.channels.ClosedChannelException.class.isInstance(throwable)) {
		return FilterReply.DENY;
	}

	return FilterReply.NEUTRAL;
}
 
开发者ID:NationStates,项目名称:NationStatesPlusPlus,代码行数:19,代码来源:LoggingFilter.java

示例13: decide

@Override
public FilterReply decide(ILoggingEvent event)
{
    if (event.getMarker().getName().equals("pircbotx.output") && (event.getMessage().contains("NICKSERV IDENTIFY") || event.getMessage().contains("PASS ")))
    {
        return FilterReply.DENY;
    }

    if (event.getMessage().contains("\u0003"))
    {
        FoxBot.getInstance().getLogger().info(Colors.removeFormattingAndColors(event.getMessage()));
        return FilterReply.DENY;
    }

    return FilterReply.NEUTRAL;
}
 
开发者ID:FoxDev,项目名称:FoxBot,代码行数:16,代码来源:LogFilter.java

示例14: decide

@Override
public FilterReply decide(ILoggingEvent event) {
    if (event.getMessage().contains("changed presence") && event.getLoggerName().equals("sx.blah.discord.Discord4J")) {
        return FilterReply.DENY;
    }
    return FilterReply.NEUTRAL;
}
 
开发者ID:tterrag1098,项目名称:MCBot,代码行数:7,代码来源:StatusChangeFilter.java

示例15: decide

@Override
public FilterReply decide(ILoggingEvent event) {
    Marker eventMarker = event.getMarker();
    if (isStarted() && (eventMarker == null || !eventMarker.contains(METRIC_MARKER))) {
        return FilterReply.DENY;
    } else {
        return FilterReply.NEUTRAL;
    }
}
 
开发者ID:symphoniacloud,项目名称:lambda-monitoring,代码行数:9,代码来源:MetricPassFilter.java


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