EventEvaluator<ILoggingEvent> ee = evaluatorList.get(i); try { if (ee.evaluate(le)) { printCallerData = true; break; errorCount++; if (errorCount < MAX_ERROR_COUNT) { addError("Exception thrown for evaluator named [" + ee.getName() + "]", eex); } else if (errorCount == MAX_ERROR_COUNT) { ErrorStatus errorStatus = new ErrorStatus("Exception thrown for evaluator named [" + ee.getName() + "].", this, eex); errorStatus.add(new ErrorStatus("This was the last warning about this evaluator's errors." + "We don't want the StatusManager to get flooded.", this));
public FilterReply decide(E event) { // let us not throw an exception // see also bug #17. if (!isStarted() || !evaluator.isStarted()) { return FilterReply.NEUTRAL; } try { if (evaluator.evaluate(event)) { return onMatch; } else { return onMismatch; } } catch (EvaluationException e) { addError("Evaluator " + evaluator.getName() + " threw an exception", e); return FilterReply.NEUTRAL; } }
className, ch.qos.logback.core.boolex.EventEvaluator.class, context); evaluator.setContext(this.context); evaluator.setName(evaluatorName);
if (eventEvaluator.evaluate(eventObject)) {
evaluator = (EventEvaluator<?>) OptionHelper.instantiateByClassName(className, ch.qos.logback.core.boolex.EventEvaluator.class, context); evaluator.setContext(this.context); evaluator.setName(evaluatorName);
@Override public boolean evaluate(ILoggingEvent event) throws EvaluationException { if (nested.evaluate(event)) { Object key = eventKey(event); Integer n = cache.getIfPresent(key); if (n == null) { n = 0; } cache.put(key, n+1); return n == 0; } else { return false; } }
/** * Once the children elements are also parsed, now is the time to activate the * evaluator options. */ @SuppressWarnings("unchecked") public void end(InterpretationContext ec, String e) { if (inError) { return; } if (evaluator instanceof LifeCycle) { ((LifeCycle) evaluator).start(); addInfo("Starting evaluator named [" + evaluator.getName() + "]"); } Object o = ec.peekObject(); if (o != evaluator) { addWarn("The object on the top the of the stack is not the evaluator pushed earlier."); } else { ec.popObject(); try { Map<String, EventEvaluator> evaluatorMap = (Map<String, EventEvaluator>) context .getObject(CoreConstants.EVALUATOR_MAP); evaluatorMap.put(evaluator.getName(), evaluator); } catch (Exception ex) { addError("Could not set evaluator named [" + evaluator + "].", ex); } } }
EventEvaluator<ILoggingEvent> ee = evaluatorList.get(i); try { if (ee.evaluate(event)) { printStack = false; break; errorCount++; if (errorCount < CoreConstants.MAX_ERROR_COUNT) { addError("Exception thrown for evaluator named [" + ee.getName() + "]", eex); } else if (errorCount == CoreConstants.MAX_ERROR_COUNT) { ErrorStatus errorStatus = new ErrorStatus("Exception thrown for evaluator named [" + ee.getName() + "].", this, eex); errorStatus.add(new ErrorStatus("This was the last warning about this evaluator's errors." + "We don't want the StatusManager to get flooded.", this));
public FilterReply decide(E event) { // let us not throw an exception // see also bug #17. if (!isStarted() || !evaluator.isStarted()) { return FilterReply.NEUTRAL; } try { if (evaluator.evaluate(event)) { return onMatch; } else { return onMismatch; } } catch (EvaluationException e) { addError("Evaluator " + evaluator.getName() + " threw an exception", e); return FilterReply.NEUTRAL; } }
className, ch.qos.logback.core.boolex.EventEvaluator.class, context); evaluator.setContext(this.context); evaluator.setName(evaluatorName);
/** * Perform SMTPAppender specific appending actions, delegating some of them to * a subclass and checking if the event triggers an e-mail to be sent. */ protected void append(E eventObject) { if (!checkEntryConditions()) { return; } subAppend(eventObject); try { if (eventEvaluator.evaluate(eventObject)) { sendBuffer(eventObject); } } catch (EvaluationException ex) { addError("SMTPAppender's EventEvaluator threw an Exception" + ex); } }
/** * Once the children elements are also parsed, now is the time to activate the * evaluator options. */ @SuppressWarnings("unchecked") public void end(InterpretationContext ec, String e) { if (inError) { return; } if (evaluator instanceof LifeCycle) { ((LifeCycle) evaluator).start(); addInfo("Starting evaluator named [" + evaluator.getName() + "]"); } Object o = ec.peekObject(); if (o != evaluator) { addWarn("The object on the top the of the stack is not the evaluator pushed earlier."); } else { ec.popObject(); try { Map<String, EventEvaluator<?>> evaluatorMap = (Map<String, EventEvaluator<?>>) context.getObject(CoreConstants.EVALUATOR_MAP); if (evaluatorMap == null) { addError("Could not find EvaluatorMap"); } else { evaluatorMap.put(evaluator.getName(), evaluator); } } catch (Exception ex) { addError("Could not set evaluator named [" + evaluator + "].", ex); } } }
EventEvaluator<ILoggingEvent> ee = evaluatorList.get(i); try { if (ee.evaluate(le)) { printCallerData = true; break; errorCount++; if (errorCount < MAX_ERROR_COUNT) { addError("Exception thrown for evaluator named [" + ee.getName() + "]", eex); } else if (errorCount == MAX_ERROR_COUNT) { ErrorStatus errorStatus = new ErrorStatus( "Exception thrown for evaluator named [" + ee.getName() + "].", this, eex); errorStatus.add(new ErrorStatus(
public FilterReply decide(E event) { // let us not throw an exception // see also bug #17. if (!isStarted() || !evaluator.isStarted()) { return FilterReply.NEUTRAL; } try { if (evaluator.evaluate(event)) { return onMatch; } else { return onMismatch; } } catch (EvaluationException e) { addError("Evaluator " + evaluator.getName() + " threw an exception", e); return FilterReply.NEUTRAL; } }
className, ch.qos.logback.core.boolex.EventEvaluator.class, context); evaluator.setContext(this.context); evaluator.setName(evaluatorName);
if (eventEvaluator.evaluate(eventObject)) {
/** * Once the children elements are also parsed, now is the time to activate the * evaluator options. */ @SuppressWarnings("unchecked") public void end(InterpretationContext ec, String e) { if (inError) { return; } if (evaluator instanceof LifeCycle) { ((LifeCycle) evaluator).start(); addInfo("Starting evaluator named [" + evaluator.getName() + "]"); } Object o = ec.peekObject(); if (o != evaluator) { addWarn("The object on the top the of the stack is not the evaluator pushed earlier."); } else { ec.popObject(); try { Map<String, EventEvaluator<?>> evaluatorMap = (Map<String, EventEvaluator<?>>) context.getObject(CoreConstants.EVALUATOR_MAP); if (evaluatorMap == null) { addError("Could not find EvaluatorMap"); } else { evaluatorMap.put(evaluator.getName(), evaluator); } } catch (Exception ex) { addError("Could not set evaluator named [" + evaluator + "].", ex); } } }
EventEvaluator<ILoggingEvent> ee = evaluatorList.get(i); try { if (ee.evaluate(event)) { printStack = false; break; errorCount++; if (errorCount < CoreConstants.MAX_ERROR_COUNT) { addError("Exception thrown for evaluator named [" + ee.getName() + "]", eex); } else if (errorCount == CoreConstants.MAX_ERROR_COUNT) { ErrorStatus errorStatus = new ErrorStatus( "Exception thrown for evaluator named [" + ee.getName() + "].", this, eex); errorStatus.add(new ErrorStatus(
public FilterReply decide(E event) { // let us not throw an exception // see also bug #17. if (!isStarted() || !evaluator.isStarted()) { return FilterReply.NEUTRAL; } try { if (evaluator.evaluate(event)) { return onMatch; } else { return onMismatch; } } catch (EvaluationException e) { addError("Evaluator " + evaluator.getName() + " threw an exception", e); return FilterReply.NEUTRAL; } }