Show Table of Contents
6.5.2. Setting log4j Priorities
log4j categories support priorities for logging levels. This means that different areas of the agent can be configured for different log levels.
Note
Do not set the
RHQ_AGENT_DEBUG environment variable if you are setting priorities in the log4j.xml file. The environment variable overrides this log4j.xml configuration.
To enable debug logging for a category, change the priority value to
DEBUG:
- Open the agent
log4jfile:# vim agentRoot/rhq-agent/conf/log4j.xml
- Reset the
priorityelement for the category. By default, the agent configuration has logging for both incoming and outgoing server-agent communication and for the baseorg.rhqclass. Optionally, logging can be enabled for plug-in class loaders and JBoss remoting communication.<!-- ================ --> <!-- Limit categories --> <!-- ================ --> <!-- RHQ --> <category name="org.rhq"> <priority value="INFO"/> </category> <!-- RHQ outgoing command tracing - set to TRACE to trace commands sent by the agent --> <category name="org.rhq.enterprise.communications.command.client.OutgoingCommandTrace"> <priority value="NONE"/> <appender-ref ref="COMMANDTRACE"/> </category> ... - Restart the agent to load the new configuration.
The
log4j file format is described more in the Apache log4j documentation.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.