Questo contenuto non è disponibile nella lingua selezionata.
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.
| 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.
Download dependencies to the JBoss JMS client and log manager.
If you are using Maven, add the following dependencies to your
pom.xmlfile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information, see the section on using Maven with JBoss EAP in the JBoss EAP Development Guide.
Create a properties file for the logger. Name it
logging.propertiesand 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.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the client with the expected parameters. When starting your client code using the
javacommand, add the following parameters:Add the JBoss client and logger JARs to the class path:
-cp /PATH/TO/jboss-client.jar:/PATH/TO/jboss-logmanager.jar
-cp /PATH/TO/jboss-client.jar:/PATH/TO/jboss-logmanager.jarCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the JBoss logging manager:
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Djava.util.logging.manager=org.jboss.logmanager.LogManagerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the location of the logging properties file:
-Dlogging.configuration=/PATH/TO/logging.properties
-Dlogging.configuration=/PATH/TO/logging.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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
$ 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