Examples of IThrowableProxy


Examples of ch.qos.logback.classic.spi.IThrowableProxy

    // the event's marker is null. However, this would surprise user who
    // expect to see a null marker instead of a dummy one.
    values[i++] = loggingEvent.getMarker();
    values[i++] = loggingEvent.getMDCPropertyMap();

    IThrowableProxy iThrowableProxy = loggingEvent.getThrowableProxy();

    if (iThrowableProxy != null) {
      values[i++] = iThrowableProxy;
      if (iThrowableProxy instanceof ThrowableProxy) {
        values[i++] = ((ThrowableProxy) iThrowableProxy).getThrowable();
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

  protected void postProcess(Object eventObject, OutputStream sw) {
    ILoggingEvent event = (ILoggingEvent) eventObject;

    String prefix = prefixLayout.doLayout(event);

    IThrowableProxy tp = event.getThrowableProxy();
    while (tp != null) {
      StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
      try {
        for (StackTraceElementProxy step : stepArray) {
          StringBuilder sb = new StringBuilder();
          sb.append(prefix).append(CoreConstants.TAB).append(step);
          sw.write(sb.toString().getBytes());
          sw.flush();
        }
      } catch (IOException e) {
        break;
      }
      tp = tp.getCause();
    }
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

  }

  public String convert(ILoggingEvent event) {
    StringBuilder buf = new StringBuilder(32);

    IThrowableProxy tp = event.getThrowableProxy();
    if (tp == null) {
      return CoreConstants.EMPTY_STRING;
    }

    // an evaluator match will cause stack printing to be skipped
    if (evaluatorList != null) {
      boolean printStack = true;
      for (int i = 0; i < evaluatorList.size(); i++) {
        EventEvaluator<ILoggingEvent> ee = evaluatorList.get(i);
        try {
          if (ee.evaluate(event)) {
            printStack = false;
            break;
          }
        } catch (EvaluationException eex) {
          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));
            addStatus(errorStatus);
          }
        }
      }

      if (!printStack) {
        return CoreConstants.EMPTY_STRING;
      }
    }

    while (tp != null) {
      printThrowableProxy(buf, tp);
      tp = tp.getCause();
    }
    return buf.toString();
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

    }

    @Override
    public Throwable getThrowable() {
        Throwable result = null;
        IThrowableProxy throwableProxy = loggingEvent.getThrowableProxy();
        if (null != throwableProxy) {
            if (throwableProxy instanceof ThrowableProxy) {
                result = ((ThrowableProxy) throwableProxy).getThrowable();
            }
        }
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

                map.put(CONTEXT_ATTR_NAME, msg);
            }
        }

        if (this.includeException) {
            IThrowableProxy throwableProxy = event.getThrowableProxy();
            if (throwableProxy != null) {
                String ex = throwableProxyConverter.convert(event);
                if (ex != null && !ex.equals("")) {
                    map.put(EXCEPTION_ATTR_NAME, ex);
                }
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

    // nop
  }

  public String convert(ILoggingEvent event) {

    IThrowableProxy tp = event.getThrowableProxy();
    if (tp == null) {
      return CoreConstants.EMPTY_STRING;
    }

    // an evaluator match will cause stack printing to be skipped
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

    return throwableProxyToString(tp);
  }

  protected String throwableProxyToString(IThrowableProxy tp) {
    StringBuilder buf = new StringBuilder(32);
    IThrowableProxy currentThrowable = tp;
    while (currentThrowable != null) {
      subjoinThrowableProxy(buf, currentThrowable);
      currentThrowable = currentThrowable.getCause();
    }
    return buf.toString();
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

  protected void postProcess(Object eventObject, OutputStream sw) {
    if (throwableExcluded)
      return;

    ILoggingEvent event = (ILoggingEvent) eventObject;
    IThrowableProxy tp = event.getThrowableProxy();

    if (tp == null)
      return;

    String stackTracePrefix = stackTraceLayout.doLayout(event);
    boolean isRootException = true;
    while (tp != null) {
      StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
      try {
        handleThrowableFirstLine(sw, tp, stackTracePrefix, isRootException);
        isRootException = false;
        for (StackTraceElementProxy step : stepArray) {
          StringBuilder sb = new StringBuilder();
          sb.append(stackTracePrefix).append(step);
          sw.write(sb.toString().getBytes());
          sw.flush();
        }
      } catch (IOException e) {
        break;
      }
      tp = tp.getCause();
    }
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

  }

  public String convert(ILoggingEvent event) {
    StringBuilder buf = new StringBuilder(32);

    IThrowableProxy tp = event.getThrowableProxy();
    if (tp == null) {
      return CoreConstants.EMPTY_STRING;
    }

    // an evaluator match will cause stack printing to be skipped
    if (evaluatorList != null) {
      boolean printStack = true;
      for (int i = 0; i < evaluatorList.size(); i++) {
        EventEvaluator<ILoggingEvent> ee = evaluatorList.get(i);
        try {
          if (ee.evaluate(event)) {
            printStack = false;
            break;
          }
        } catch (EvaluationException eex) {
          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));
            addStatus(errorStatus);
          }
        }
      }

      if (!printStack) {
        return CoreConstants.EMPTY_STRING;
      }
    }

    while (tp != null) {
      printThrowableProxy(buf, tp);
      tp = tp.getCause();
    }
    return buf.toString();
  }
View Full Code Here

Examples of ch.qos.logback.classic.spi.IThrowableProxy

  protected void postProcess(Object eventObject, SyslogWriter sw) {
    ILoggingEvent event = (ILoggingEvent) eventObject;

    String prefix = prefixLayout.doLayout(event);

    IThrowableProxy tp = event.getThrowableProxy();
    while (tp != null) {
      StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
      try {
        for (StackTraceElementProxy step : stepArray) {
          sw.write(prefix);
          sw.write(CoreConstants.TAB);
          sw.write(step.toString());
          sw.flush();
        }
      } catch (IOException e) {
        break;
      }
      tp = tp.getCause();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.