Enabling logging for Git Integration Toolkit (Linux only)

To help with troubleshooting, enable logging of the IBM® Engineering Workflow Management (EWM) Git Integration Toolkit.

About this task

After you enable logging for Git Integration Toolkit, messages from the hook files are written into a log file. Once the feature is enabled, irrespective of the current trace level that is being used, only error level trace messages are sent to the console. This feature is available only on Linux systems. Each time a pre-receive or post-receive hook is triggered, a new file is created into which all the messages that are generated by the hook are logged. You can create only a limited number of files. After the limit is reached, the messages from the hook will be written into one of the existing files. The file that is to be overwritten is selected based on modification time for the log files. This condition means that the files that are modified recently will not be overwritten.

Procedure

  1. Open the configuration file hookslogging.properties.sample from the path EWM-Git-Integration-Toolkit>/config/logging.
    Using this configuration file, you can configure the number of files that can be created along with the location where the log files are created.
    Note: Remove the word .sample from the configuration file name to use the configuration file.
  2. Specify the appropriate values to the following properties in the configuration file.
    Property Description
    FILE_COUNT

    This property determines the number of log files that can be created, each at the locations specified by PRE_RECEIVE_LOG_DIR and POST_RECEIVE_LOG_DIR. After the number of log files is equal to FILE_COUNT, any further triggering of the hooks generates messages to be written into an existing file by overwriting it.

    PRE_RECEIVE_LOG_DIR

    The path that is specified for this property determines the directory under which the log files that contain the messages from the pre-receive hook are created. The path that is specified must be an absolute path and the Git process must have write permission on the directory. In the context of Gerrit, the log files contain messages from the ref-update hook.

    POST_RECEIVE_LOG_DIR

    The path that is specified for this property determines the directory under which the log files that contain the messages from the post-receive hook are created. The path that is specified must be an absolute path and the Git process must have write permission on the directory. In the context of Gerrit, the log files contain messages from the ref-updated and patchset-created hook.

    PRE_RECEIVE_TRACE_LEVEL

    The value that is specified for this property is used as the default value for the trace level in pre-receive hook. The trace level that is specified in the pre-receive hook file takes precedence.

    POST_RECEIVE_TRACE_LEVEL

    The value that is specified for this property is used as the default value for the trace level in post-receive hook. The trace level that is specified in the post-receive hook file takes precedence.

    Note:
    • This feature involves file writing and due to this, performance of the EWM Git integration is going to be impacted. Because of the impact in the performance, it is recommended to use this feature for diagnostic purposes rather than normal usage.
    • This hookslogging.properties feature is supported only for GitLab, Gerrit, and NodeJs.