當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。