mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
网关直接内存溢出优化:新增访问日志过滤器开关
This commit is contained in:
@@ -17,6 +17,10 @@ import java.util.Set;
|
||||
@Data
|
||||
public class CfGatewayProperties {
|
||||
|
||||
/**
|
||||
* 是否开启网关访问日志
|
||||
*/
|
||||
private boolean accessLogEnable = true;
|
||||
|
||||
/**
|
||||
* 需要忽略打印requestBody和responseBody的请求地址列表
|
||||
|
||||
@@ -131,6 +131,11 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||
// accessLog不开启,转发filter
|
||||
if (!cfGatewayProperties.isAccessLogEnable()) {
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
|
||||
// 将 Request 中可以直接获取到的参数,设置到网关日志
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
// TODO traceId
|
||||
|
||||
Reference in New Issue
Block a user