diff --git a/continew-starter-log/continew-starter-log-common/src/main/java/top/charles7c/continew/starter/log/common/annotation/Log.java b/continew-starter-log/continew-starter-log-common/src/main/java/top/charles7c/continew/starter/log/common/annotation/Log.java index c48cf2f1..1b73f099 100644 --- a/continew-starter-log/continew-starter-log-common/src/main/java/top/charles7c/continew/starter/log/common/annotation/Log.java +++ b/continew-starter-log/continew-starter-log-common/src/main/java/top/charles7c/continew/starter/log/common/annotation/Log.java @@ -51,12 +51,12 @@ public @interface Log { /** * 包含信息(在全局配置基础上扩展包含信息) */ - Include[] include() default {}; + Include[] includes() default {}; /** * 排除信息(在全局配置基础上减少包含信息) */ - Include[] exclude() default {}; + Include[] excludes() default {}; /** * 是否忽略日志记录(用于接口方法或类上) diff --git a/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/autoconfigure/LogProperties.java b/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/autoconfigure/LogProperties.java index 9fe7dfee..cca5241b 100644 --- a/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/autoconfigure/LogProperties.java +++ b/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/autoconfigure/LogProperties.java @@ -45,7 +45,7 @@ public class LogProperties { /** * 包含信息 */ - private Set include = new HashSet<>(Include.defaultIncludes()); + private Set includes = new HashSet<>(Include.defaultIncludes()); public boolean isEnabled() { return enabled; @@ -63,11 +63,11 @@ public class LogProperties { isPrint = print; } - public Set getInclude() { - return include; + public Set getIncludes() { + return includes; } - public void setInclude(Set include) { - this.include = include; + public void setIncludes(Set includes) { + this.includes = includes; } } diff --git a/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/LogFilter.java b/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/LogFilter.java index 832a97e0..30d4482f 100644 --- a/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/LogFilter.java +++ b/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/LogFilter.java @@ -105,7 +105,7 @@ public class LogFilter extends OncePerRequestFilter implements Ordered { * @return true:是;false:否 */ private boolean isRequestWrapper(HttpServletRequest request) { - Set includeSet = logProperties.getInclude(); + Set includeSet = logProperties.getIncludes(); return !(request instanceof ContentCachingRequestWrapper) && (includeSet .contains(Include.REQUEST_BODY) || includeSet.contains(Include.REQUEST_PARAM)); } @@ -117,7 +117,7 @@ public class LogFilter extends OncePerRequestFilter implements Ordered { * @return true:是;false:否 */ private boolean isResponseWrapper(HttpServletResponse response) { - Set includeSet = logProperties.getInclude(); + Set includeSet = logProperties.getIncludes(); return !(response instanceof ContentCachingResponseWrapper) && (includeSet .contains(Include.RESPONSE_BODY) || includeSet.contains(Include.RESPONSE_PARAM)); } diff --git a/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/LogInterceptor.java b/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/LogInterceptor.java index af785e5d..77b6219b 100644 --- a/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/LogInterceptor.java +++ b/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/LogInterceptor.java @@ -117,7 +117,7 @@ public class LogInterceptor implements HandlerInterceptor { * @return 日志包含信息 */ private Set getIncludes(Log methodLog, Log classLog) { - Set includeSet = logProperties.getInclude(); + Set includeSet = logProperties.getIncludes(); if (null != classLog) { this.processInclude(includeSet, classLog); } @@ -134,11 +134,11 @@ public class LogInterceptor implements HandlerInterceptor { * @param logAnnotation Log 注解 */ private void processInclude(Set includes, Log logAnnotation) { - Include[] includeArr = logAnnotation.include(); + Include[] includeArr = logAnnotation.includes(); if (includeArr.length > 0) { includes.addAll(Set.of(includeArr)); } - Include[] excludeArr = logAnnotation.exclude(); + Include[] excludeArr = logAnnotation.excludes(); if (excludeArr.length > 0) { includes.removeAll(Set.of(excludeArr)); }