Examples of IThrowableProxy


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

    appendKeyValue(buf, "level", event.getLevel().toString());
    buf.append(COMMA);
    appendKeyValue(buf, "thread", event.getThreadName());
    buf.append(COMMA);
    appendKeyValue(buf, "level", event.getLevel().toString());
    IThrowableProxy tp = event.getThrowableProxy();
    if (tp != null) {
      buf.append(COMMA);
      String throwable = ThrowableProxyUtil.asString(tp);
      appendKeyValue(buf, "throwable", throwable);
    }
View Full Code Here

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

    FileWriter fw = new FileWriter(targetFile);
    for (ILoggingEvent e : eventArray) {
      fw.write(e.toString());
      fw.append(CoreConstants.LINE_SEPARATOR);
      if (e.getThrowableProxy() != null) {
        IThrowableProxy tp = e.getThrowableProxy();
        fw.write(ThrowableProxyUtil.asString(tp));
      }
    }
    fw.flush();
    fw.close();
View Full Code Here

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

    }
  }

  public String fullDump(ILoggingEvent evt) {
    try {
      IThrowableProxy proxy = evt.getThrowableProxy();
      if(proxy == null)
        return null;
     
      StringBuilder builder = new StringBuilder();
      for (StackTraceElementProxy step : proxy
          .getStackTraceElementProxyArray()) {
        String string = step.toString();
        builder.append(CoreConstants.TAB).append(string);
        ThrowableProxyUtil.subjoinPackagingData(builder, step);
        builder.append(CoreConstants.LINE_SEPARATOR);
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

    IThrowableRenderer<ILoggingEvent> {

  static final String TRACE_PREFIX = "<br />&nbsp;&nbsp;&nbsp;&nbsp;";

  public void render(StringBuilder sbuf, ILoggingEvent event) {
    IThrowableProxy tp = event.getThrowableProxy();
    sbuf.append("<tr><td class=\"Exception\" colspan=\"6\">");
    while (tp != null) {
      render(sbuf, tp);
      tp = tp.getCause();
    }
    sbuf.append("</td></tr>");
  }
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

  public DefaultThrowableRenderer() {
  }

  public void render(StringBuilder sbuf, ILoggingEvent event) {
    IThrowableProxy tp = event.getThrowableProxy();
    sbuf.append("<tr><td class=\"Exception\" colspan=\"6\">");
    while (tp != null) {
      render(sbuf, tp);
      tp = tp.getCause();
    }
    sbuf.append("</td></tr>");
  }
View Full Code Here

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

    // logback does not support NDC
    // String ndc = event.getNDC();


    IThrowableProxy tp = event.getThrowableProxy();
    if (tp != null) {
      StackTraceElementProxy[] stepArray = tp.getStackTraceElementProxyArray();
      buf.append("  <log4j:throwable><![CDATA[");
      for (StackTraceElementProxy step : stepArray) {
        buf.append(CoreConstants.TAB);
        buf.append(step.toString());
        buf.append("\r\n");
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.