此内容没有您所选择的语言版本。

Chapter 5. Configuring Logging


You can configure logging for the messaging-activemq subsystem by adding a log category in the JBoss EAP logging subsystem for org.apache.activemq and setting the desired log level. You can also configure a log handler for the category to configure how the log messages are recorded.

To see more information in the logs regarding XA transactions, change the log level of the com.arjuna category to a more verbose setting such as TRACE or DEBUG.

For more information on logging, including configuration for categories and other options, see the section on logging in the JBoss EAP Configuration Guide.

Expand
Table 5.1. Logging Categories
If you want logs for…​Use this category…​

XA transactions

com.arjuna

All messaging activity

org.apache.activemq

Messaging Journal calls only

org.apache.activemq.artemis.journal

JMS calls only

org.apache.activemq.artemis.jms

Messaging utils calls only

org.apache.activemq.artemis.utils

Messaging core server only

org.apache.activemq.artemis.core.server

Configuring a Client for Logging

Configure messaging clients by following these steps.

  1. Download dependencies to the JBoss JMS client and log manager.

    If you are using Maven, add the following dependencies to your pom.xml file:

    <dependencies>
      ...
      <dependency>
         <groupId>org.jboss.logmanager</groupId>
         <artifactId>jboss-logmanager</artifactId>
         <version>1.5.3.Final</version>
      </dependency>
      <dependency>
          <groupId>org.jboss.eap</groupId>
          <artifactId>wildfly-jms-client-bom</artifactId>
          <type>pom</type>
      </dependency>
      ...
    </dependencies>
    Copy to Clipboard Toggle word wrap

    For more information, see the section on using Maven with JBoss EAP in the JBoss EAP Development Guide.

  2. Create a properties file for the logger. Name it logging.properties and save it to a known location. Below is an example properties file. See the section on logging in the JBoss EAP Development Guide for more information on configuring logging options on the client side.

    # Root logger option
    loggers=org.jboss.logging,org.apache.activemq.artemis.core.server,org.apache.activemq.artemis.utils,org.apache.activemq.artemis.journal,org.apache.activemq.artemis.jms,org.apache.activemq.artemis.ra
    
    # Root logger level
    logger.level=INFO
    # Apache ActiveMQ Artemis logger levels
    logger.org.apache.activemq.artemis.jms.level=INFO
    logger.org.apache.activemq.artemis.journal.level=INFO
    logger.org.apache.activemq.artemis.utils.level=INFO
    logger.org.apache.activemq.artemis.core.server.level=INFO
    
    # Root logger handlers
    logger.handlers=FILE
    
    # File handler configuration
    handler.FILE=org.jboss.logmanager.handlers.FileHandler
    handler.FILE.level=FINE
    handler.FILE.properties=autoFlush,fileName
    handler.FILE.autoFlush=true
    handler.FILE.fileName=activemq.log
    handler.FILE.formatter=PATTERN
    
    # Formatter pattern configuration
    formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
    formatter.PATTERN.properties=pattern
    formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c] %s%E%n
    Copy to Clipboard Toggle word wrap
  3. Start the client with the expected parameters. When starting your client code using the java command, add the following parameters:

    1. Add the JBoss client and logger jars to the class path:

      -cp /path/to/jboss-client.jar:/path/to/jboss-logmanager.jar
      Copy to Clipboard Toggle word wrap
    2. Enable the JBoss logging manager:

      -Djava.util.logging.manager=org.jboss.logmanager.LogManager
      Copy to Clipboard Toggle word wrap
    3. Set the location of the logging properties file:

      -Dlogging.configuration=/path/to/logging.properties
      Copy to Clipboard Toggle word wrap

    The full command to start the client will look something like the following example:

    $ java -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=/path/to/logging.properties -cp /path/to/jboss-client.jar:/path/to/jboss-logmanager.jar org.example.MyClient
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat