gpt4 book ai didi

java - 禁用 Spring boot websocket MessageBroker 日志的 INFO 级别日志记录

转载 作者:行者123 更新时间:2023-11-30 07:52:03 27 4
gpt4 key购买 nike

我有一个 spring boot 应用程序,它启用了 Websocket 和 SockJs。一切正常,但它一直在控制台中记录以下消息。

2017-09-19 11:04:48.164  INFO 8856 --- [MessageBroker-4] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[1 current WS(1)-HttpStream(0)-HttpPoll(0), 3 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(3)-CONNECTED(3)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 45], outboundChannelpool size = 0, active threads = 0, queued tasks = 0, completed tasks = 22], sockJsScheduler[pool size = 4, active threads = 1, queued tasks = 2, completed tasks = 65909]

日志的意义是什么?如何才能仅禁用这些类型的日志记录?

最佳答案

尝试在 application.properties 中使用以下配置:

logging.level.org.springframework.web.socket.config.WebSocketMessageBrokerStats = ERROR

这将升级这个特定类的日志。

关于java - 禁用 Spring boot websocket MessageBroker 日志的 INFO 级别日志记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46292669/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com