Logging

Applies to Collaborator 11.5, last modified on December 21, 2021

Collaborator servers log messages to several log files which are user configurable (with two exceptions). The configurable log files are all, by default, located in <Collaborator Server>/tomcat/logs. These are collab.log (and numbered generations of same when logs roll) for application level logging and license.log which logs license usage events, such as user login and logout (if enabled). The logs that do not allow user configuration are located in the installation directory and are named output.log and error.log, which capture the standard out and standard error streams from the application. Normally, Collaborator does not write to standard out or error, but some of the libraries that it uses do. Occasionally, these logs will be helpful for debugging issues in one of those libraries.

Configure Logging With Configuration Files

Collaborator uses a sophisticated logging system, log4j, to manage the logging. Because of the breadth of configuration options available in log4j, it is not possible to document everything here (the log4j documentation is available at http://logging.apache.org/log4j/1.2/manual.html). However, in this section, we will cover some common scenarios.

The configuration file for collab.log and license.log can be found in <Collaborator Server>/tomcat/webapps/ROOT/WEB-INF/classes/log4j.properties. The file is a plain text Java properties file and can be edited with any text editor. Changes will take effect when the server is restarted.

Changes applied to the log4j.properties file will not be saved between updates to Collaborator. Upon editing this file, it is a good idea to save a backup of the file in a location outside the Collaborator installation tree.

Basic debug logging

The most common configuration change that system administrators will make is to turn on debug logging. This can be useful when working with the SmartBear technical support to resolve issues (though this is not always required). To enable debug logging, find the first non-comment line in the file:

log4j.rootLogger=info, CodeCollaborator

This line configures the base level logging to the info level and attaches an appender named CodeCollaborator that will be configured later in the file. To enable debug logging, simply replace info with debug and restart the server. Do not change the name of the appender as this will result in the log configuration not being available via JMX. Running a production system at debug logging level can cause performance issues, so it is not recommended unless specifically directed by the SmartBear technical support.

Log rolling

By default the collab.log file is rolled when it reaches 10 Mb and saves 10 generations of files, for a total of 110Mb of disk space potentially consumed. Both of these values can be configured in the log configuration file. The following lines specify these values:

log4j.appender.CodeCollaborator.MaxFileSize=10MB
log4j.appender.CodeCollaborator.MaxBackupIndex=10

System administrators may change these values as necessary to capture additional logging information or conserve disk space as necessary.

Enable license logging

Collaborator can log license events (users logging in and out) to help you understand your license consumption. By default this is disabled, as it is normally not necessary. The system status page includes graphs which are helpful for understanding the total license consumption. However, drilling down to find what users are using the system when requires turning on license logging. To do this, change the license logging level from warn to info:

log4j.logger.com.smartbear.ccollab.license=warn, CodeCollaboratorLicense

The license log appender is also configured to roll like collab.log, and this configuration can be changed in a similar manner. However, it is important that you not change the appender name from CodeCollaboratorLicense, as this will result in the log configuration not being available via JMX.

Control Logging With JMX

If the Collaborator server has JMX management enabled, the logging level can be changed at runtime. All of the log configuration MBeans are available at com.smartbear.ccollab:/:Logging. Changing the priority field value on Application Logger or License Logger will change the base level of logging for the application and the license log respectively.

You can find the appenders under the following names: Application Log and License Log. The max size, number of backups, and even the file names, can be changed in JMX. The changes will not take effect until the activateOptions operation is invoked. In jconsole, operations are found in a separate tab.

Changes applied with JMX do not persist across server restarts.
The JMX console

Click the image to enlarge it.

See Also

JMX Monitoring
Backup and Migration
Admin Tasks

Highlight search results