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

Attribute

Description

Log Files Location

You can set the log file location using the log4j.appender.R.File option, specifying the relative or full path of the log file. This option instructs the log4j system to use the specified path for logging.

Maximum file size

You can set the maximum file size for the log file using the log4j.appender.R.MaxFileSize option. By default, the maximum log file size is 5000KB.

Number of roll-over files

You can set the number of roll-over files using the log4j.appender.R.MaxBackupIndex option. When a log file reaches its maximum size, a backup file is made and a new log file is created. This value controls how many backup files are retained. By default, the maximum number of roll-over files is 5.

Performance logging

You can enable logging of performance-related information pertaining to the Application Server. To do so, locate the BlDeploy appserver performance logging section in the file and uncomment the lines in that section.

Timing for Deploy Jobs

You can enable logging of timing information pertaining to the Deploy Jobs. To do so, locate the timing for deploy jobs section in the file and uncomment the lines in that section.

Content Authoring Log configuration

You can enable logging of Content Authoring debug information. To do so, locate the Content Authoring related debug logs section in the file and uncomment the lines in that section.

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.

The following video demonstrates how to set up BMC Sever Automation Application Servers in debug mode.

  https://youtu.be/K05Yq7Vj5fw

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.

    Attribute

    Description

    ConsoleLogfileName

    The name or full path of the console log file for the Application Server. The console log file contains all information logged to the Application Server log, plus any information logged to the console. When you create a new Application Server, BMC Server Automation sets the console log file's name to the Application Server name plus "_console". This convention avoids conflicts when there are multiple Application Servers on the same host. If you edit this attribute, specify a name that is unique on the host. Console logging is enabled by default. To disable console logging, set the ConsoleLogfileName to be empty.

    LogfileName

    The name or full path of the log file for the Application Server. When you create a new Application Server, BMC Server Automation sets the log file's name to the Application Server name plus the .log extension. This convention avoids conflicts when there are multiple Application Servers on the same host. If you edit this attribute, specify a name that is unique on the host.

  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.

Was this page helpful? Yes No Submitting... Thank you

Comments