You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为ActiveMQ Artemis特定日志器开TRACE及配置分流日志

Let's break down your two ActiveMQ Artemis logging questions with clear, actionable steps:

1. Enabling TRACE-level logging for a specific logger in ActiveMQ Artemis

ActiveMQ Artemis uses Java Util Logging (JUL) under the hood, so all logging configuration lives in the etc/logging.properties file in your Artemis instance directory. Here's how to target a specific logger:

  • Open up etc/logging.properties in a text editor.
  • Locate (or add) the line for your target logger. The format is [logger-name].level = TRACE. For example, if you wanted to target the divert implementation class (which ties into your second question), you'd add:
    org.apache.activemq.artemis.core.server.impl.DivertImpl.level = TRACE
    
  • Critical check: Make sure the handler responsible for writing logs (like the FileHandler for artemis.log) is set to accept TRACE-level logs. If the handler's level is set to INFO or higher, it will filter out TRACE messages. Update it like this:
    java.util.logging.FileHandler.level = TRACE
    
  • Save the file and restart your ActiveMQ Artemis server for the changes to take effect.
2. Configuring logging.properties to log divert activity to artemis.log

Since you specifically mentioned targeting org.apache.activemq.artemis.core.server.impl.DivertImpl with TRACE level, here's the step-by-step to ensure those logs end up in artemis.log:

  • First, confirm your logging.properties already has a FileHandler configured for artemis.log (this is usually default, but double-check):
    handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
    java.util.logging.FileHandler.level = INFO
    java.util.logging.FileHandler.formatter = org.apache.activemq.artemis.utils.ActiveMQFormatter
    java.util.logging.FileHandler.pattern = ${artemis.instance}/log/artemis.log
    
  • Update the FileHandler's level to TRACE so it can capture the detailed divert logs:
    java.util.logging.FileHandler.level = TRACE
    
  • Add the specific logger configuration for the divert implementation to enable TRACE logging:
    org.apache.activemq.artemis.core.server.impl.DivertImpl.level = TRACE
    
  • Optional: If you don't want these TRACE logs cluttering your console, you can disable parent handler inheritance for this logger so logs only go to artemis.log:
    org.apache.activemq.artemis.core.server.impl.DivertImpl.useParentHandlers = false
    org.apache.activemq.artemis.core.server.impl.DivertImpl.handlers = java.util.logging.FileHandler
    
  • Save the configuration file, restart Artemis, and you'll start seeing detailed TRACE logs from the divert implementation in artemis.log.

内容的提问来源于stack exchange,提问作者ZiggyStardust

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 17:17:52