修复异常打印日志BUG
This commit is contained in:
@@ -109,7 +109,7 @@ public class HttpLogFilter extends BaseFilter implements Ordered, BaseParams {
|
||||
|
||||
// 处理异常日志
|
||||
LogLevel level = LogLevel.INFO;
|
||||
boolean printLog = true;
|
||||
Boolean printLog = null;
|
||||
if (!PathPatternUtils.match(RESP_WHITE_LIST, uri)) {
|
||||
// 获取响应内容
|
||||
Object respData = getContent(responseWrapper.getContentAsByteArray());
|
||||
@@ -128,7 +128,11 @@ public class HttpLogFilter extends BaseFilter implements Ordered, BaseParams {
|
||||
// 将内容复制回原始响应
|
||||
responseWrapper.copyBodyToResponse();
|
||||
// 记录响应日志
|
||||
LogBus.init(level, LogBusBaseType.HTTP_REQUEST).print(printLog).data(log).save();
|
||||
LogBus logBus = LogBus.init(level, LogBusBaseType.HTTP_REQUEST).data(log);
|
||||
if (Objects.nonNull(printLog)) {
|
||||
logBus.print(printLog);
|
||||
}
|
||||
logBus.save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user