Controlling Application Server logging
This topic contains the following sections:
- Overview of Application Server logging
- Modifying logging configuration using log4j2.xml
- To enable basic debug logging
- Syslog and the appserver log
- To modify log file names from the TrueSight 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 log4j2.xml 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 log4j2.xml file.
Modifying logging configuration using log4j2.xml
In addition to controlling the logging information, the log4j2.xml 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 log4j2.xml file. There are comments within the file describing other options not defined here.
Modifying basic Application Server logging attributes
Additional debug logging
The log4j2.xml 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 log4j2.xml file control loggers that are useful for debugging:
- <Logger name="com.bladelogic.app.db.DBServiceImpl" level="debug"/> - This logger controls messages generated by the database service.
- <Logger name="com.bladelogic.mfw.demux.Demux" level="debug"/> - This logger controls messages generated by the networking layer.
See the comment lines in the log4j2.xml file for additional information about these logger options.
To enable basic debug logging
- Open the log4j2.xml file.
Locate the following line:
<Root level="info">Modify the line to read:
<Root level="debug">
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, uncomment the SYSLOG appender located in the <Appenders> xml tag of the log4j2.xml file, and add its reference to the root logger as shown in the following example.
<AppenderRef ref="Rolling"/>
<AppenderRef ref="Console"/>
<AppenderRef ref="SYSLOG"/>
</Root>
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 TrueSight Server Automation Console
You can also modify basic logging options for the Application Server from the TrueSight Server Automation Console.
- In the TrueSight 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 log4j2.xml file using the same attributes that are applied to Application Server logging (Appender.Rolling.MaxFileSize and Appender.Rolling.MaxBackupIndex properties), as described in the list of Application Server logging attributes.