Controlling Application Server logging
This topic contains the following sections:
- Overview of Application Server logging
- Modifying logging configuration using log4j.properties
- To enable basic debug logging
- Syslog and the appserver log
- To modify log file names from the BMC Server Automation Console
- Enabling more detailed logging
Overview of Application Server logging
Logging is controlled at the Application Server instance level. Within the configuration files for each specific deployment, logging is controlled by the log4j.properties configuration file, which is located in the Application Server installation directory for that deployment. By default, the file is located in
By default, Application Server logging output is written to the appserver.log file, also located in the Application Server installation directory for the specific deployment.
The following sections provide information about the log4j.properties file.
Modifying logging configuration using log4j.properties
In addition to controlling the logging information, the log4j.properties file can also control where the logging information is stored and how the log files are managed. This section describes how to manipulate some of the basic properties of the configuration file.
Modifying basic logging attributes
The following table describes some of the basic log attributes that can be controlled by modifying options in the log4j.properties file. There are comments within the file describing other options not defined here.
Modifying basic Application Server logging attributes
Additional debug logging
The log4j.properties file contains a large list of loggers that can be configured to add useful debug information. These loggers are initially configured with the log level INFO to prevent the log files from containing too much information. When debugging specific issues with the system, you can modify one or more of the specified loggers in the file to set the log level to DEBUG.
There are many logger options that give you the ability to enable debug logging for very specific tasks. For example, the following options in the log4j.properties file control loggers that are useful for debugging:
- log4j.logger.com.bladelogic.app.db.DBServiceImpl - This logger controls messages generated by the database service.
- log4j.logger.com.bladelogic.mfw.demux.Demux - This logger controls messages generated by the networking layer.
See the comment lines in the log4j.properties file for additional information about these logger options.
To enable basic debug logging
- Open the log4j.properties file.
Locate the following line:
log4j.rootLogger=INFO, R, CModify the line to read:
log4j.rootLogger=DEBUG, R, CAfter the update is saved, the application server automatically detects the logging level modification after a short period of time and being logging data in debug mode.
Syslog and the appserver log
You can choose to send the contents of the appserver log to the syslog. To do this, in the log4j.properties, add a new section for syslog with the syslog appender in the rootLogger line, as in the following example:
log4j.rootLogger=INFO, R, C, SYSLOG
# R is the RollingFileAppender that outputs to a rolling log
# file called appserver.log.
log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender
log4j.appender.SYSLOG.syslogHost=localhost
log4j.appender.SYSLOG.facility=LOCAL6
log4j.appender.SYSLOG.facilityPrinting=false
log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout
log4j.appender.SYSLOG.layout.conversionPattern=[%d{DATE.EN_US}]
[%t] [%p] [%X{USER.EN_US}:%X{ROLE.EN_US}:%X{IP.EN_US}]
[%X{ACTION.EN_US}] %m%n
After adding this section, modify the syslog daemon on your Application Server to send whatever is sent to the LOCAL6 facility to either a local log file or to a remote syslog server. For instructions on how to do this, consult your syslog daemon's documentation.
To modify log file names from the BMC Server Automation Console
You can also modify basic logging options for the Application Server from the BMC Server Automation Console.
- In the BMC Server Automation Console, from the Configuration menu, select Infrastructure Management.
- Expand the hierarchy of the Application Servers node.
- Right-click the Application Server you want to edit and select Edit. The Edit Application Server Profile dialog box opens.
In the Edit Application Server Profile dialog box, add or change values for the following attributes.
- When you are finished editing the profile, click OK.
- Click OK on the warning that configuration changes do not take effect until you restart the Application Server.
- Start or restart the Application Server to have changes take effect.
Enabling more detailed logging
In addition to the appserver.log file, an Application Server running on Linux or Solaris can be configured to write all the standard output and standard error information into a file called console.log.
The console.log file is useful for debugging when certain output is not captured by the regular log files. The console.log file contains the same information as the appserver.log file, but in addition it also captures any output that does not go through the log4j logging system. For example, information such as the java thread dump and any messages generated by third party code used by the Application Server that logs messages to standard out/err.
As with the Application Server log files, the console log files are configured to rollover. You can set the maximum file size and number of roll-over files for the console log file in the log4j.properties file using the same attributes that are applied to Application Server logging (the log4j.appender.R.MaxFileSize option and log4j.appender.R.MaxBackupIndex option), as described in the list of Application Server logging attributes.