禁用Spring引导websocket MessageBroker日志的INFO级别日志记录

时间:2017-09-19 05:43:45

标签: java logging spring-boot spring-websocket sockjs

我有一个Spring启动应用程序,启用了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]

日志的重要性是什么以及如何仅禁用这些类型的日志记录?

1 个答案:

答案 0 :(得分:3)

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

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

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