Log files and logging configuration for Global Configuration Management

If you encounter errors or exceptions, you can use the log files to research the issues and find resolutions.

The following log files are relevant to Global Configuration Management:
  • gc.log: Logging for the Global Configuration Management application and services.
  • gcTrsRepair.log: Logging for repair operations on Global Configuration ManagementTracked Resource Set (TRS).
  • gcSdkContributionCache.log: Logging for cache update events. Although a file is created, events are logged only when enabled.
Note: Your log names might be different. The log name prefix (gc) is based on the default application context root, and the name can be customized in the logging configuration file.
The default location of the log files depends on your application server:
  • Liberty: JazzInstallDir/server/logs
  • IBM WebSphere®: WASInstallDir/server/profiles/<profile_name>/logs

Logging configuration

The logging configuration for Global Configuration Management can be found in the log4j2.xml file that is at JazzInstallDir/server/conf/<gcContextRoot>/log4j2.xml. The configuration can be modified based on specific requirements.

Changing the location of the log files
In the log4j2.xml file, find the line:
<Property name="baseDir">logs</Property>
Change the value ("logs") to a directory path of your preference. For example,
<Property name="baseDir">/tmp/logs</Property>
Managing the size of the log file
In the log4j2.xml file, the default size of the log file is 10 MB and the number of backup files is 5. You can change the roll-over property in the log4j2.xml file, as needed.
To change the size-based roll-over, update the numbers in the following lines:
<SizeBasedTriggeringPolicy size="10MB"/>
<DefaultRolloverStrategy max="5"/>
Managing the name of the roll-over log file
In the log4j2.xml file, find the string
filePattern="${baseDir}/${app}-%i.log">
Change it as you wanted. For example,
filePattern="${baseDir}/${app}.log.%i">

This sets the roll-over log file name to gc.log.1 instead of the default gc-1.log.

Changing the timestamp of events in all the log files
In the log4j2.xml file, find the line
<Property name="pattern">%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%30t] %5p %-50.50c %X{Tid} - %m%n</Property>
Change it as wanted. For example,
<Property name="pattern">"%d{dd MMM yyyy HH:mm:ss,SSS} [%30t] %5p %-50.50c %X{Tid} - %m%n"</Property>
To change the timestamp only in the gc.log, find the following line:
<RollingRandomAccessFile name="defaultGcLog" fileName="${baseDir}/${app}.log"
Beneath the previous line, change the following lines, as you wanted.
<PatternLayout pattern="${pattern}"/>
For example,
<PatternLayout pattern="%d{dd MMM yyyy HH:mm:ss,SSS} [%30t] %5p %-50.50c %X{Tid} - %m%n"/>

This displays the timestamp as 08 Apr 2022 14:34:02,123.

Adding trace output to the application log
The following example shows how to configure the most verbose output to the gc.log file. The log file can help you to discover the details of a problem for a specific operation.
  1. In the log4j2.xml file, configure the Root logger to log the most granular level—TRACE—and all the messages.
    Find the line:
    <Root level="WARN">
    Change the line to:
    <Root level="TRACE">
  2. Increase the maximum size of the appender file to accommodate the additional output.
    Find the line:
    <RollingRandomAccessFile name="defaultGcLog" fileName="${baseDir}/${app}.log"
    Beneath the previous line, you find:
    <SizeBasedTriggeringPolicy size="10MB"/>
    Change the line to:
    <SizeBasedTriggeringPolicy size="100MB"/>
  3. Wait 10 seconds for the changes to get picked up or reload the configuration, as described in the next section.
Enabling debug messages for global configuration services
This section is a reference for customers who are directed by IBM Support to debug problems that are related to the Global Configuration Management application in their working environment.

If you are directed to enable logging for global configuration services, you can do so in the log4j2.xml file. IBM Support helps you to troubleshoot that uses the information logged.

  • Set the Global Configuration API Service logger to DEBUG (or TRACE).
    Note: Calls to a service method are logged with the input parameters and any result or exception.
    Find the line in log4j2.xml:
    <Logger name="com.ibm.team.gc.service.internal.GcApiService" level="INFO" />
    Replace it with the following line:
    <Logger name="com.ibm.team.gc.service.internal.GcApiService" level="DEBUG" />
  • Add a Global Configuration Front Service logger with DEBUG level.
    Find the line:
    <Logger name="com.ibm.team.gc.sdk.service.internal.GlobalConfigurationService" level="INFO" />
    Insert the following lines beneath it:
    <Logger name="com.ibm.team.gc.web.frontservice" level="DEBUG" />
  • Add HttpUtils logger with DEBUG level.
    Insert the following lines:
    Note: This setting logs details of requests Global Configuration Management makes to other tools, and the results that are returned.
    <Logger name="com.ibm.team.gc.common.HttpUtils" level="DEBUG" />
  • Set the Configurations Front Service logger to DEBUG (or TRACE).
    Find the following lines:
    <Logger name="com.ibm.team.gc.service.front.ConfigurationFrontService" level="INFO" />
    Replace it with the following line:
    <Logger name="com.ibm.team.gc.service.front.ConfigurationFrontService" level="DEBUG" />

Reloading the log4j2.xml file dynamically

Any changes that you make to log4j2.xml are automatically picked up by the application in about 10 seconds, by default. Alternatively, the configuration can be reloaded as described in the following steps.

  1. Open the Application Administration - Global Configuration Management page to reload the settings.

    https://<hostname>:9443/<gcContextRoot>/admin#action=com.ibm.team.repository.admin.reloadLoggingSettings

  2. Click Reload Log Settings.

    The reload is successful if you see the following message under Reload Log Settings: Log Settings reloaded = [true]