Working with HCL OneTest™ API logs

To configure the HCL OneTest™ API logs, including those for the RunTest command when run from the command line, update the HCL OneTest™ API logging properties file.
Note: The logs that are referred to in this topic are associated with the execution of the HCL OneTest™ API application itself, and not the HCL OneTest™ API Log action that can be added to the steps of a test.
  1. In the home installation directory of HCL OneTest™ API, locate it-logging.properties.
  2. Open it-logging.properties in a text editor.
  3. Configure the logging handlers:
    You can have HCL OneTest API write the logs to a console, to a file, or to both. Locate the property that configures the type of logging to use and update it as needed. For example,
    handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
    By default, only console logging is enabled for HCL OneTest™ API.
    By default, the log files for HCL OneTest API are written to the logs directory that is located in the home installation directory of HCL OneTest™ API.
    Note: The naming convention of the log files has changed over the releases. Starting from version 9.2, the HCL OneTest™ API log file is called integration-tester*.log.
  4. Set the log level:
    Use the following properties in it-logging.properties to define the log level:
    • java.util.logging.ConsoleHandler.level: The maximum level of message that can be output to the console. Messages with a lower priority than this level are not displayed on the console.
    • java.util.logging.FileHandler.level: The maximum level of message that can be output to the log file. Messages with a lower priority than this level are not included in the log file.
    • product_packages.level: The level at which messages that are output from the corresponding packages are generated. It is typical for all packages to be set at the same level.
    Set the properties to any of the following built-in log levels: SEVERE (to show the least amount of details on worst error conditions only), WARNING, INFO, CONFIG, FINE, FINER, FINEST (to display every message with more detail, most of which are not errors).
    Warning: Log levels associated with lower severity such as FINER and FINEST output large amounts of data to the logs, which might make your debugging process difficult. Therefore, do not use them unless necessary.
    In this example, both console logging and file logging are enabled. Console logging is configured to log only SEVERE and WARNING messages. File logging is configured to log all possible messages, including the FINEST details. The HCL OneTest API product packages are configured to export messages for all product classes to the logging components with the FINEST details.
    #------------------------------- TYPE OF LOGGING ------------------------------
    handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
    #---------------------------- DEFAULT LOGGING LEVEL --------------------------- 
    .level = INFO
    #------------------------------ CONSOLE LOGGING -------------------------------
    java.util.logging.ConsoleHandler.level = WARNING
    #------------------------------- FILE LOGGING ---------------------------------
    java.util.logging.FileHandler.level = FINEST
    java.util.logging.FileHandler.pattern = %b/logs/integration-tester-%u.log
    java.util.logging.FileHandler.limit = 5000000
    java.util.logging.FileHandler.count = 1
    #------------------------------ PACKAGE LOG LEVELS ----------------------------
    product_packages.level = FINEST
  5. For any changes you made to the logging configuration to take effect, restart HCL OneTest™ API.

Viewing the log output on the console

Navigate to Help > About > JVM Console or press Ctrl-Shift-J. This action opens the Java console, which displays logs as they are generated when HCL OneTest™ API runs.

(OR)

Do the following steps:
  1. In the HCL OneTest™ API installation directory, locate IntegrationTester.exe (on Windows computers) or IntegratonTester executable (on non-Windows computers).
  2. Open a command prompt and run the executable file with the -console option. For example, IntegrationTester -console. Starting HCL OneTest API from the command line fetches the console messages into the command window.
Remember: The JVM Console is not the same as the test execution console.
Note: Only one instance of HCL OneTest™ API can be active at a time. Therefore, before running the executable from the command line, make sure that you close any previously running instance of HCL OneTest™ API.

Configuring the RunTests logs

When you run the RunTests executable or Apache Ant "IntegrationTester" task in HCL OneTest™ API, you can use both console logging and file logging. Logging for RunTests is also controlled by the same configuration settings as for HCL OneTest™ API, by the it-logging.properties file. You must ensure that the logging configuration file specified in RunTests.ini has the same changes applied to it while setting the log level for HCL OneTest API.
  1. In the HCL OneTest™ API installation directory, locate RunTests.ini.
  2. Find the property labeled -Djava.util.logging.config.file and verify its value. By default, this property points to the same file as it does in IntegrationTester.ini. Therefore, no additional changes are required.

Optional: Setting the log file location and patterns

Locate the property in it-logging.properties that defines the log file patterns and update it as needed. For example, java.util.logging.FileHandler.pattern=%b/logs/integration-tester-%u.log. For information about what each substitution variables (for example, %b) means, see the comments in it-logging.properties.

Optional: Changing the name and location of the logging properties file

Change the name and location of the logging properties files as follows:
  1. Navigate to the home installation directory of HCL OneTest™ API and locate the IntegrationTester.ini file.
  2. Open IntegrationTester.ini in a text editor.
  3. Locate the property that defines the logging properties file (-Djava.util.logging.config.file) and update the value as required. For example:
    -Djava.util.logging.config.file=./C:/myfolder/logs/itLog.properties
Feedback