IBM Support

How to enable log4j traces for repotools commands

Question & Answer


Question

How do you enable log4j traces when you run repotools commands in IBM Engineering Lifecycle Management (ELM)?

Cause

A repotools command fails to run and you need to turn on more traces to debug the command. Enabling trace can be helpful if repotools crashes or hangs when it runs.

Answer

Log4j version 1 was replaced with log4j version 2.17 or later in ELM 7.0.2 SR1 (iFix015) and 7.0.1 SR1 (iFix018)

Steps to Enable a log4j Trace for Repotools Commands:
For ELM 7.0.2 SR1 (iFix015) and later, and 7.0.1 SR1 (iFix018) and later:
  1. Determine the log4j setting you want to enable
  2. Open <ELM_INSTALL_DIR>\server\conf\repotools_log4j.xml for editing
  3. Search in the file and ensure that the log4j trace you want to enable does not exist.
    • For example, you want to enable the 'com.ibm.team.repository.servlet.AbstractTeamServerServlet' logger. You can search for the text in the file and ensure it does not exist.
  4. Review How to update log4j v2 configuration files for how to edit log4j v2 configurations.
    • If the logger exists in the file, you can modify the log level to the appropriate level.
    • If the logger does not exist, you can add it to the file. The example shows how to set the 'com.ibm.team.repository.servlet.AbstractTeamServerServlet' logger to the TRACE level:
       
      <Logger name="com.ibm.team.repository.servlet.AbstractTeamServerServlet" level="TRACE" />
  5. Save changes
For ELM versions before 7.0.2 SR1 and 7.0.1 SR1:
  1. Determine the log4j setting you want to enable
  2. Open <ELM_INSTALL_DIR>\server\conf\repotools_log4j.properties for editing
  3. Search in the file and ensure that the log4j trace you want to enable does not exist.
    • For example, you want to enable the 'com.ibm.team.repository.servlet.AbstractTeamServerServlet' logger. You can search for the text in the file and ensure it does not exist.
  4. Review Working with Log4j v1 in ELM for how to edit log4j configurations.
    • If the logger exists in the file, you can modify the log level to the appropriate level.
    • If the logger does not exist, you can add it to the file. The example shows how to set the 'com.ibm.team.repository.servlet.AbstractTeamServerServlet' logger to the TRACE level:
       
      log4j.logger.com.ibm.team.repository.servlet.AbstractTeamServerServlet=TRACE
  5. Save changes
Running repotools command:
  • <ELM_INSTALL_DIR>\server\conf\ is the default location for repotools log4j file and is used when you run a repotools command. However, if you want to create repotools log4j file in a different location, you can specify the new location in the repotools command by adding the log4j.properties parameter to the command.
    For example,
    repotools -createTables log4j.properties=C:\Temp\custom_repotools_log4j.properties

[{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSPRJQ","label":"IBM Engineering Lifecycle Management Base"},"ARM Category":[{"code":"a8m0z000000CbOVAA0","label":"Jazz Team Server-\u003ERepotools"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Product Synonym

ELM

Document Information

Modified date:
26 January 2023

UID

swg21322003