grpc.netty.NettyClientHandler 日志
2023-10-19 本文已影响0人
我还是老油条
由于项目中引入了nacos导致grpc.netty.NettyClientHandler的心跳日志不停的打印
看着特别烦
[grpc-nio-worker-ELG-1-4] DEBUG io.grpc.netty.shaded.io.grpc.netty.NettyClientHandler.log - [id: 0x6413875c, L:/xxx:58478 - R:logging.googleapis.com/142.251.42.202:443] INBOUND HEADERS: streamId=207 headers=GrpcHttp2ResponseHeaders[grpc-status: 0, content-disposition: attachment] padding=0 endStream=true
[grpc-nio-worker-ELG-1-4] DEBUG io.grpc.netty.shaded.io.grpc.netty.NettyClientHandler.log - [id: 0x6413875c, L:/xxx:58478 - R:logging.googleapis.com/142.251.42.202:443] OUTBOUND HEADERS: streamId=459 headers=GrpcHttp2OutboundHeaders[:authority: logging.googleapis.com:443, :path: /google.logging.v2.LoggingServiceV2/WriteLogEntries, :method: POST, :scheme: https, content-type: application/grpc, te: trailers, user-agent: grpc-java-netty/1.39.0, x-goog-api-client: gl-java/11.0.10 gccl/2.3.2 gapic/2.3.2 gax/1.66.0 grpc/1.39.0, grpc-accept-encoding: gzip, authorization: Bearer ya29.c.b0AXv0zTNJXzltMy4mjSxLeBBi5FEjdutXjFapVXcbzZAkTR3NmGbQTCas6LsKA0N2OMAwlrH45Vo2TsxXA_gnhiIkOBUFoGpmltPxKln_vVYQcXsc6ogfViKv5RfSTFdFQF9vbvIpD5WMlYNBxeLVZjczD5zqQVYHYX9MyW9dcAF8U8B3MpYiOGam5gljwxEPevleZtRrdaMT9N1XwrQOQ4akSdZFyJU, grpc-timeout: 49999860u] streamDependency=0 weight=16 exclusive=false padding=0 endStream=false
怎么调整logback的配置都没有用,最后发现原来日志用的log4j的
改动方案:
由于spring-booot-startter-web 排除了logback的包,所以需要把logback的包
放开
放开前:
image.png
放开后:
image.png
然后启动应该会报错,需要把log4j的包排除掉,就可以了