在 Tomcat 中运行的 Spring 应用程序中禁用 ActiveMQ 的日志记录
Posted
技术标签:
【中文标题】在 Tomcat 中运行的 Spring 应用程序中禁用 ActiveMQ 的日志记录【英文标题】:Disable logging for ActiveMQ in Spring application running in Tomcat 【发布时间】:2020-04-30 19:12:54 【问题描述】:我有一个在 Tomcat 上运行的 Java 传统 Spring Web 应用程序,它调用 ActiveMQ。
我的控制台充满了InactivityMonitor
日志条目(见下文):
21:54:02.759 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.759 [ActiveMQ InactivityMonitor WriteCheckTimer] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - WriteChecker 10009 ms elapsed since last write check.
21:54:02.759 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.759 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.759 [ActiveMQ InactivityMonitor WriteCheckTimer] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - WriteChecker 10007 ms elapsed since last write check.
21:54:02.759 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.759 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.778 [ActiveMQ InactivityMonitor WriteCheckTimer] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - WriteChecker 10009 ms elapsed since last write check.
21:54:02.778 [ActiveMQ InactivityMonitor WriteCheckTimer] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - WriteChecker 10009 ms elapsed since last write check.
21:54:02.778 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.778 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.794 [ActiveMQ InactivityMonitor WriteCheckTimer] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - WriteChecker 10010 ms elapsed since last write check.
21:54:02.794 [ActiveMQ InactivityMonitor WriteCheckTimer] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - WriteChecker 10010 ms elapsed since last write check.
21:54:02.794 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.794 [ActiveMQ InactivityMonitor WriteCheckTimer] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - WriteChecker 10010 ms elapsed since last write check.
21:54:02.795 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.795 [ActiveMQ InactivityMonitor WriteCheckTimer] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - WriteChecker 10011 ms elapsed since last write check.
21:54:02.795 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
21:54:02.795 [ActiveMQ InactivityMonitor Worker] DEBUG org.apache.activemq.transport.AbstractInactivityMonitor - Running WriteCheck[tcp://127.0.0.1:61616]
如何禁用日志记录到控制台或将警告级别从 DEBUG 更改为 WARN 以减少 Eclipse 控制台中的消息?
【问题讨论】:
你在这上面找到什么了吗?我也在搜索。 【参考方案1】:log4j.logger.org.apache.activemq=WARN
https://activemq.apache.org/how-do-i-change-the-logging
【讨论】:
正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center。以上是关于在 Tomcat 中运行的 Spring 应用程序中禁用 ActiveMQ 的日志记录的主要内容,如果未能解决你的问题,请参考以下文章
在 Tomcat 中部署的 Spring Boot 提供 404 但可以独立运行
无法在 Spring Boot 应用程序(Tomcat 服务器)中运行 localhost