Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Controlling Application Server logging


This topic contains the following sections:

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

<installDirectory>/br/deployments/<deploymentName>/log4j.properties

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.

Note

Debugging issues with the Application Server often require assistance from BMC Customer Support.

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

  1. Open the log4j.properties file.
  2. Locate the following line:

    log4j.rootLogger=INFO, R, C
  3. Modify the line to read:

    log4j.rootLogger=DEBUG, R, C

    After 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:

# By default we will write to logger defined by "R" and "C"# By default we will write to logger defined by "R" and "C"
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.

  1. In the BMC Server Automation Console, from the Configuration menu, select Infrastructure Management.
  2. Expand the hierarchy of the Application Servers node.
  3. Right-click the Application Server you want to edit and select Edit. The Edit Application Server Profile dialog box opens.
  4. In the Edit Application Server Profile dialog box, add or change values for the following attributes.

  5. When you are finished editing the profile, click OK.
  6. Click OK on the warning that configuration changes do not take effect until you restart the Application Server.
  7. 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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*