5. Configuring Servers
The JBoss ON configuration is edited in one of two areas, depending on the configuration setting:
- In the JBoss ON GUI
Note
Settings that can be edited in the JBoss ON UI must be edited in the JBoss ON UI. - In the
rhq-server.properties
configuration file
Additional configuration is stored in the database backend used by the JBoss ON server.
5.1. Enabling Debug Logging for the JBoss ON Server
Debug mode records debugging messages caused or encountered by the start scripts to the server logs.
Debug messages are in the log file,
serverRoot/jon-server-3.1.2.GA1/logs/rhq-server-log4j.log
.
In some cases, you will want debug messages from the JBoss ON server launcher scripts. To do this, you need to set the environment variable
RHQ_SERVER_DEBUG
to any value. After setting this variable when you start the launcher, scripts will output debug messages.
5.1.1. Using an Environment Variable
The quickest way to enable debug logging is to set the
RHQ_SERVER_DEBUG
environment variable to any value before starting the server.
5.1.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_SERVER_DEBUG
environment variable if you are setting priorities in the rhq-server-log4j.xml
file. The environment variable overrides this rhq-server-log4j.xml
configuration.
Warning
Do not modify anything else in the
jbossas
directory. This could adversely affect the performance of the JBoss ON server.
To enable debug logging for a category, change the priority value to
DEBUG
:
- Open the
jboss-log4j.xml
file:# vim serverRoot/jon-server-3.1.2.GA1/jbossas/server/default/conf/jboss-log4j.log
- Uncomment the
org.rhq
category to set the priority for all JBoss ON server subsystems to DEBUG.<category name="org.rhq"> <priority value="DEBUG"/> </category>
Alternatively, set DEBUG priorities for individual subsystems in the server. Uncomment the specific categories and set thepriority
element for the category to DEBUG. Many categories are defined for JBoss ON server subsystems, including database upgrades, global concurrency settings, inventory reports, authorization, alerting, and the UI. There are also categories for third-party subsystems like JBoss/Remoting and Hibernate. For example:... <!-- <category name="org.rhq.enterprise.server.alert"> <priority value="DEBUG"/> </category> --> <!-- <category name="org.rhq.enterprise.server.authz"> <priority value="DEBUG"/> </category> --> <!-- <category name="org.rhq.enterprise.server.event"> <priority value="DEBUG"/> </category> --> <!-- <category name="org.rhq.enterprise.server.measurement"> <priority value="DEBUG"/> </category> --> ...
Note
By default, the console window will not display debug messages. This is because the log4jCONSOLE
appender has a threshold atINFO
. For debug messages to appear in the UI, change theCONSOLE
appender's threshold setting toDEBUG
.<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="Target" value="System.out"/> <param name="Threshold" value="DEBUG"/> ....
- Restart the server to load the new configuration.
serverRoot/jon-server-3.1.2.GA1/bin/rhq-server.sh stop
The
log4j
file format is described more in the Apache log4j documentation.
5.1.3. Dumping Current Server State to the Logs
Having a record of the current state of the server configuration can be useful for debugging and auditing. The current server details — such as its build number, database information, and measurement schedules — can be exported immediately to the server log.
- Click the Administration tab in the top menu.
- In themenu table on the left, select the item.
- In the main window, scroll to the bottom of the server configuration, and click thebutton.
- All of the current server settings and details are printed to the server log.
2012-05-14 19:44:28,587 INFO [SystemInfoManager] SystemInformation: ******** CAM_LDAP_BIND_PW: [- non null -] AlertDefinitionCount: [2] CAM_LDAP_BASE_DN: [o=JBoss,c=US] AVAILABILITY_PURGE: [31536000000] CAM_JAAS_PROVIDER: [false] BuildNumber: [ca099bc:3a46aff] ServerCount: [27] DATABASE_DRIVER_NAME: [PostgreSQL Native Driver] RESOURCE_GENERIC_PROPERTIES_UPGRADE: [false] ... 8< ...