refactor(log): 优化访问日志启用属性名

This commit is contained in:
2025-03-26 21:29:30 +08:00
parent 89a347ffe6
commit e294d69cdb
2 changed files with 6 additions and 6 deletions

View File

@@ -174,7 +174,7 @@ public abstract class AbstractLogHandler implements LogHandler {
public void accessLogStart(AccessLogContext accessLogContext) { public void accessLogStart(AccessLogContext accessLogContext) {
AccessLogProperties properties = accessLogContext.getProperties().getAccessLog(); AccessLogProperties properties = accessLogContext.getProperties().getAccessLog();
// 是否需要打印 规则: 是否打印开关 或 放行路径 // 是否需要打印 规则: 是否打印开关 或 放行路径
if (!properties.isPrint() || accessLogContext.getProperties() if (!properties.isEnabled() || accessLogContext.getProperties()
.isMatch(accessLogContext.getRequest().getPath())) { .isMatch(accessLogContext.getRequest().getPath())) {
return; return;
} }

View File

@@ -34,7 +34,7 @@ public class AccessLogProperties {
* 不记录请求日志也支持开启打印访问日志 * 不记录请求日志也支持开启打印访问日志
* </p> * </p>
*/ */
private boolean isPrint = false; private boolean enabled = false;
/** /**
* 是否打印请求参数body/query/form * 是否打印请求参数body/query/form
@@ -82,12 +82,12 @@ public class AccessLogProperties {
*/ */
private List<String> sensitiveParams = new ArrayList<>(); private List<String> sensitiveParams = new ArrayList<>();
public boolean isPrint() { public boolean isEnabled() {
return isPrint; return enabled;
} }
public void setPrint(boolean print) { public void setEnabled(boolean enabled) {
isPrint = print; this.enabled = enabled;
} }
public boolean isPrintRequestParam() { public boolean isPrintRequestParam() {