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


Java IThrowableProxy.getMessage方法代码示例

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


在下文中一共展示了IThrowableProxy.getMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: transformStackTrace

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
private String transformStackTrace(ILoggingEvent event) {
    IThrowableProxy throwableProxy = event.getThrowableProxy();
    StackTraceElement stackTraceElement = throwableProxy.getStackTraceElementProxyArray()[0].getStackTraceElement();

    String time = DEFAULT_DATE_FORMAT.format(new Date(event.getTimeStamp()));
    String threadName = event.getThreadName();
    String level = event.getLevel().toString().substring(0, 1);
    String logger = event.getLoggerName();
    String exception = throwableProxy.getClassName();
    String msg = throwableProxy.getMessage();
    String className = stackTraceElement.getClassName();
    String method = stackTraceElement.getMethodName();
    int lineNumber = stackTraceElement.getLineNumber();

    return String.format(FORMAT_MESSAGE, title, time, threadName, level, logger, exception, msg, className, method, lineNumber);
}
 
开发者ID:mitaketw,项目名称:logback-sms-appender,代码行数:17,代码来源:SmsAppender.java

示例2: buildCausalString

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
/**
 * Builds an exception causation string by following the exception caused-by chain.
 * @param exception The exception to process.
 * @return A string describing all exceptions in the chain.
 */
private static String buildCausalString(IThrowableProxy exception)
{
  final StringBuilder buff = new StringBuilder();

  buff.append(exception.getClassName());
  if (exception.getMessage() != null)
  {
    buff.append(": ").append(exception.getMessage());
  }

  if (exception.getCause() != null)
  {
    buff.append("; caused by: ").append(buildCausalString(exception.getCause()));
  }

  return buff.toString();
}
 
开发者ID:gkopff,项目名称:logback-raygun,代码行数:23,代码来源:RaygunAppender.java

示例3: toProto

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
private static Proto.Throwable toProto(IThrowableProxy t) {
    Proto.Throwable.Builder builder = Proto.Throwable.newBuilder()
            .setClassName(t.getClassName());
    String message = t.getMessage();
    if (message != null) {
        builder.setMessage(message);
    }
    for (StackTraceElementProxy element : t.getStackTraceElementProxyArray()) {
        builder.addStackTraceElement(ErrorMessage.toProto(element.getStackTraceElement()));
    }
    builder.setFramesInCommonWithEnclosing(t.getCommonFrames());
    IThrowableProxy cause = t.getCause();
    if (cause != null) {
        builder.setCause(toProto(cause));
    }
    for (IThrowableProxy suppressed : t.getSuppressed()) {
        builder.addSuppressed(toProto(suppressed));
    }
    return builder.build();
}
 
开发者ID:glowroot,项目名称:glowroot,代码行数:21,代码来源:CollectorLogbackAppender.java

示例4: append

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
@Override
protected void append(ILoggingEvent event) {
    event.prepareForDeferredProcessing();
    //todo do more elegant streaming approach to publish logs

    if (!event.getLevel().equals(Level.ALL) &&         // OFF AND ALL are not loggable levels
            !event.getLevel().equals(Level.OFF)) {
        final IThrowableProxy throwableProxy = event.getThrowableProxy();
        final LogEntry entry = throwableProxy != null ?
                new LogEntry(serverId, event.getFormattedMessage(), Instant.ofEpochMilli(event.getTimeStamp()).toString(),
                        event.getLevel().toString(), event.getLoggerName(), event.getMDCPropertyMap(),
                        event.getThreadName() != null ? event.getThreadName() : null,
                        new Exception(throwableProxy.getMessage(), toStringArray(throwableProxy.getStackTraceElementProxyArray())
                        , throwableProxy.getClassName()))
                : new LogEntry(serverId, event.getFormattedMessage(), Instant.ofEpochMilli(event.getTimeStamp()).toString(),
                event.getLevel().toString(), event.getLoggerName(), event.getMDCPropertyMap(),
                event.getThreadName() != null ? event.getThreadName() : null);
        producer.send(new ProducerRecord<>(kafkaTopic, new Gson().toJson(entry)));
    }
}
 
开发者ID:apache,项目名称:airavata,代码行数:21,代码来源:KafkaAppender.java

示例5: exceptionInformation

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
/**
 * Pull out details of exception in a Hashmap (if they exist)
 * 
 * @param loggingEvent
 * @return
 */
protected void exceptionInformation(
    final ILoggingEvent loggingEvent) {
    final IThrowableProxy throwableInformation = loggingEvent
            .getThrowableProxy();
    if (throwableInformation != null) {
        if (throwableInformation.getClassName() != null) {
            ExceptionField.put(EXCEPTION.CLASS, throwableInformation.getClassName());
        }
        if (throwableInformation.getMessage() != null) {
            ExceptionField.put(EXCEPTION.MESSAGE, throwableInformation.getMessage());
        }
        if (throwableInformation.getStackTraceElementProxyArray() != null) {
            final String stackTrace = StringUtils.join(
                    throwableInformation.getStackTraceElementProxyArray(), "\n");
            ExceptionField.put(EXCEPTION.STACKTRACE, stackTrace);
        }
    }
}
 
开发者ID:stuart-warren,项目名称:logit,代码行数:25,代码来源:Layout.java

示例6: containsMessage

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
private boolean containsMessage(IThrowableProxy exception, String exceptionName) {
    final String message = exception.getMessage();
    if (message != null && message.contains(exceptionAndMessage.get(exceptionName))) {
        return true;
    }
    return false;
}
 
开发者ID:line,项目名称:centraldogma,代码行数:8,代码来源:ExpectedExceptionAppender.java

示例7: DefaultLogThrowable

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
DefaultLogThrowable(IThrowableProxy throwableProxy) {
  this.className = throwableProxy.getClassName();
  this.message = throwableProxy.getMessage();

  StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray();
  this.stackTraces = new StackTraceElement[stackTraceElementProxyArray.length];
  for (int i = 0; i < stackTraceElementProxyArray.length; i++) {
    stackTraces[i] = stackTraceElementProxyArray[i].getStackTraceElement();
  }

  cause = (throwableProxy.getCause() == null) ? null : new DefaultLogThrowable(throwableProxy.getCause());
}
 
开发者ID:apache,项目名称:twill,代码行数:13,代码来源:DefaultLogThrowable.java

示例8: Event

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
Event(ILoggingEvent event) {
    this.marker = event.getMarker();
    this.level = event.getLevel().toString();
    this.message = event.getMessage();
    this.arguments = event.getArgumentArray();
    final IThrowableProxy proxy = event.getThrowableProxy();
    this.thrown = proxy == null ? null : proxy.getClassName() + ": " + proxy.getMessage();
}
 
开发者ID:jhipster,项目名称:jhipster,代码行数:9,代码来源:LogbackRecorder.java

示例9: parseStringArrayMessage

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
private String parseStringArrayMessage(IThrowableProxy throwableProxy) {
    String throwableClassName = throwableProxy.getClassName();
    String throwableMessage = throwableProxy.getMessage();
    StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray();
    logger.debug("Parse exception message with"
            + stackTraceElementProxyArray.length + "elements to create the correct crash log file.");
    StringBuffer buffer = new StringBuffer();
    createFirstLine(throwableClassName, throwableMessage, buffer);

    for (StackTraceElementProxy stackColumn : stackTraceElementProxyArray) {
        buffer.append("\t").append(stackColumn.getSTEAsString()).append("\n");
    }
    return buffer.toString();
}
 
开发者ID:codewinkel,项目名称:logback-extensions,代码行数:15,代码来源:HockeyAppCrashAppenderService.java

示例10: getExceptionInfo

import ch.qos.logback.classic.spi.IThrowableProxy; //导入方法依赖的package包/类
private String getExceptionInfo(IThrowableProxy iThrowableProxy) {
    String s = iThrowableProxy.getClassName();
    String message = iThrowableProxy.getMessage();
    return (message != null) ? (s + ": " + message) : s;
}
 
开发者ID:aliyun,项目名称:aliyun-log-logback-appender,代码行数:6,代码来源:LoghubAppender.java


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