日志includes引用传递修改问题。

This commit is contained in:
httpsjt
2024-08-30 14:45:50 +08:00
parent 5e0eea2ed8
commit 52fc9d086d
2 changed files with 4 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ public class LogProperties {
/**
* 包含信息
*/
private Set<Include> includes = new HashSet<>(Include.defaultIncludes());
private Set<Include> includes = Include.defaultIncludes();
/**
* 放行路由

View File

@@ -36,6 +36,7 @@ import top.continew.starter.log.core.model.LogResponse;
import top.continew.starter.log.interceptor.autoconfigure.LogProperties;
import java.time.Clock;
import java.util.HashSet;
import java.util.Set;
/**
@@ -115,7 +116,8 @@ public class LogInterceptor implements HandlerInterceptor {
* @return 日志包含信息
*/
private Set<Include> getIncludes(Log methodLog, Log classLog) {
Set<Include> includeSet = logProperties.getIncludes();
Set<Include> oriIncludeSet = logProperties.getIncludes();
Set<Include> includeSet = new HashSet<>(oriIncludeSet);
if (null != classLog) {
this.processInclude(includeSet, classLog);
}