Skip to content

Commit

Permalink
👽 同步 ballcat 组件库改动,访问日志的最大消息体长度下沉到配置中
Browse files Browse the repository at this point in the history
  • Loading branch information
Hccake committed Apr 10, 2024
1 parent f27601c commit a8589c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public AbstractAccessLogFilter businessAccessLogFilter(AccessLogService accessLo
BusinessAccessLogFilter businessAccessLogFilter = new BusinessAccessLogFilter(defaultRecordOptions,
accessLogRules, new AccessLogSaveThread(accessLogService), principalAttributeAccessor,
defaultFilterLogLevel);
businessAccessLogFilter.setMaxBodyLength(accessLogProperties.getMaxBodyLength());
businessAccessLogFilter.setOrder(accessLogProperties.getFilterOrder());
return businessAccessLogFilter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ protected void afterRequest(HttpServletRequest request, HttpServletResponse resp

// 记录请求体
if (recordOptions.isIncludeRequestBody()) {
accessLog.setRequestBody(getRequestBody(request));
String requestBody = getRequestBody(request, recordOptions.getMaxRequestBodyLength());
accessLog.setRequestBody(requestBody);
}

// 记录响应体
if (recordOptions.isIncludeResponseBody()) {
accessLog.setResponseBody(getResponseBody(response));
String responseBody = getResponseBody(response, recordOptions.getMaxResponseBodyLength());
accessLog.setResponseBody(responseBody);
}

// 如果登录用户 则记录用户名和用户id
Expand Down

0 comments on commit a8589c5

Please sign in to comment.