fix (接口自动化): 修复执行控制台异常日志不输出问题
This commit is contained in:
parent
3ff5f03f90
commit
0080615344
|
@ -1,6 +1,7 @@
|
|||
package io.metersphere.api.jmeter;
|
||||
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.classic.spi.StackTraceElementProxy;
|
||||
import ch.qos.logback.core.UnsynchronizedAppenderBase;
|
||||
import io.metersphere.commons.utils.DateUtils;
|
||||
import io.metersphere.commons.utils.LogUtil;
|
||||
|
@ -23,6 +24,16 @@ public class JmeterLoggerAppender extends UnsynchronizedAppenderBase<ILoggingEve
|
|||
.append(event.getLevel()).append(" ")
|
||||
.append(event.getThreadName()).append(" ")
|
||||
.append(event.getFormattedMessage()).append("\n");
|
||||
|
||||
if (event.getThrowableProxy() != null) {
|
||||
message.append(event.getThrowableProxy().getMessage()).append("\n");
|
||||
message.append(event.getThrowableProxy().getClassName()).append("\n");
|
||||
if (event.getThrowableProxy().getStackTraceElementProxyArray() != null) {
|
||||
for (StackTraceElementProxy stackTraceElementProxy : event.getThrowableProxy().getStackTraceElementProxyArray()) {
|
||||
message.append(" ").append(stackTraceElementProxy.getSTEAsString()).append("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (logger.containsKey(event.getTimeStamp())) {
|
||||
logger.get(event.getTimeStamp()).append(message);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue