Ce contenu n'est pas disponible dans la langue sélectionnée.

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
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat