Enabling and disabling remote diagnostic logging for the HTTP/TCP proxy

To facilitate troubleshooting, HCL Quality Server administrators can view, download, and share detailed log events information for the HTTP/TCP proxy. The capability to display this information in HCL Quality Server requires enabling remote diagnostic logging for the proxy.

About this task

HCL Quality Server can display a diagnostic log that is a centralized view of log events of HCL OneTest API proxies.

By default, remote diagnostic logging to HCL Quality Server is not enabled in HCL OneTest API Agent or in the proxies supplied with HCL Quality Server.

Depending on the operating system of the computer upon which the HTTP/TCP proxy is installed, there are two ways to enable or disable remote diagnostic logging to HCL Quality Server for the HTTP/TCP proxy:
  • If you are using Unix-like systems, or Microsoft Windows, you can modify the startup file of the proxy, which is located in <HCL Quality Server installation directory>\httptcp.
  • If you are using Microsoft Windows, you also have the option to enable or disable remote diagnostic logging for the HTTP/TCP proxy by modifying the HCL OneTest API HTTP/TCP Proxy Windows service.
    Note: This Windows service is installed if you selected the Install Service and Start on Boot options for the HTTP/TCP proxy while installing HCL Quality Server. By default, those settings are selected in IBM® Installation Manager,

Procedure

  1. To modify the startup file of the HTTP/TCP proxy, perform the following tasks:
    1. Use a text editor to open the startup.bat file if you are using Microsoft Windows or startup.sh if you are using Unix-like systems.
      Table 1. HTTP/TCP proxy startup file locations for enabling or disabling remote proxy logging
      Location in startup.bat file where you can make changes Location in startup.sh file where you can make changes

      %_RUNJAVA% -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false -cp ghproxy.jar com.greenhat.proxy.Main

      "$_RUNJAVA" -Djava.util.logging.config.file="$_SCRIPTDIR/logging.properties" -cp "$_SCRIPTDIR/ghproxy.jar" com.greenhat.proxy.Main

    2. Edit the file as shown in the following table:
      Table 2. Parameters for enabling and disabling remote diagnostic logging for the HTTP/TCP proxy to HCL Quality Server
      To: Change startup.bat as follows: Change startup.sh as follows:

      Enable remote diagnostic logging at debug level to HCL Quality Server.

      Note: Available levels are error, warning, info, debug, and trace. The Java.Util.Logging (JUL) appender defaults to "level:debug" if level is not set, so all events are passed to Java.Util and filtered there by the separate configuration.

      %_RUNJAVA% -Dgreenhat.logappender.net.NET=level:DEBUG -Dgreenhat.logappender.jul.JUL -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false -cp ghproxy.jar com.greenhat.proxy.Main

      "$_RUNJAVA" -Dgreenhat.logappender.net.NET=level:DEBUG -Dgreenhat.logappender.jul.JUL -Djava.util.logging.config.file="$_SCRIPTDIR/logging.properties" -cp "$_SCRIPTDIR/ghproxy.jar" com.greenhat.proxy.Main

      Enable remote diagnostic logging at debug level to HCL Quality Server and specify the URL for the network log appender.

      Note: Available levels are error, warning, info, debug, and trace. Instead of entering a specific URL, you can enter url:auto.

      %_RUNJAVA% -Dgreenhat.logappender.net.NET=url:http://IP address or host name:port_number/RTCP,level:DEBUG -Dgreenhat.logappender.jul.JUL -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false -cp ghproxy.jar com.greenhat.proxy.Main

      "$_RUNJAVA" -Dgreenhat.logappender.net.NET=url:http://IP address or host name:port_number/RTCP,level:DEBUG -Dgreenhat.logappender.jul.JUL -Djava.util.logging.config.file="$_SCRIPTDIR/logging.properties" -cp "$_SCRIPTDIR/ghproxy.jar" com.greenhat.proxy.Main

      Enable remote diagnostic logging at debug level and internal logging to HCL Quality Server.

      Note: Available levels are error, warning, info, debug, and trace.

      %_RUNJAVA% -Dgreenhat.logappender.net.NET=level:DEBUG -Dgreenhat.logappender.jul.JUL -Dgreenhat.loginternal=appender -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false -cp ghproxy.jar com.greenhat.proxy.Main

      "$_RUNJAVA" -Dgreenhat.logappender.net.NET=level:DEBUG -Dgreenhat.logappender.jul.JUL -Dgreenhat.loginternal=appender -Djava.util.logging.config.file="$_SCRIPTDIR/logging.properties" -cp "$_SCRIPTDIR/ghproxy.jar" com.greenhat.proxy.Main

      Enable remote diagnostic logging at error or warning level to HCL Quality Server.

      Note: Default remote log level is warning.
      Note: The Java.Util.Logging (JUL) appender is not present, so there will be no local file logging.

      %_RUNJAVA% -Dgreenhat.logappender.net.NET -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false -cp ghproxy.jar com.greenhat.proxy.Main

      "$_RUNJAVA" -Dgreenhat.logappender.net.NET -Djava.util.logging.config.file="$_SCRIPTDIR/logging.properties" -cp "$_SCRIPTDIR/ghproxy.jar" com.greenhat.proxy.Main

      Enable console logging at debug level and use detailed layout.

      Note: If Java logging is not enabled, you might want to enable console logging. Console logging layout can be detailed, standard, or compact.

      %_RUNJAVA% -Dgreenhat.logappender.console.CONSOLE=layout:detailed,level:DEBUG -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false -cp ghproxy.jar com.greenhat.proxy.Main

      "$_RUNJAVA" -Dgreenhat.logappender.console.CONSOLE=layout:detailed,level:DEBUG -Djava.util.logging.config.file="$_SCRIPTDIR/logging.properties" -cp "$_SCRIPTDIR/ghproxy.jar" com.greenhat.proxy.Main

      Enable console logging at debug level, use detailed layout, and log internal framework events.

      Note: Internal events will be sent to the console to help diagnose issues within the logging framework.

      %_RUNJAVA% -Dgreenhat.logappender.console.CONSOLE=layout:detailed,level:DEBUG - Dgreenhat.loginternal=console -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false -cp ghproxy.jar com.greenhat.proxy.Main

      "$_RUNJAVA" -Dgreenhat.logappender.console.CONSOLE=layout:detailed,level:DEBUG - Dgreenhat.loginternal=console -Djava.util.logging.config.file="$_SCRIPTDIR/logging.properties" -cp "$_SCRIPTDIR/ghproxy.jar" com.greenhat.proxy.Main

      Disable all logging.

      %_RUNJAVA% -Dgreenhat.logappender.none -Djava.util.logging.config.file=logging.properties -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false -cp ghproxy.jar com.greenhat.proxy.Main

      "$_RUNJAVA" -Dgreenhat.logappender.none -Djava.util.logging.config.file="$_SCRIPTDIR/logging.properties" -cp "$_SCRIPTDIR/ghproxy.jar" com.greenhat.proxy.Main

    3. Save and close the file.
    4. Restart the proxy if you selected the Install Service and Start on Boot options for the HTTP/TCP proxy while installing HCL Quality Server.
  2. Alternatively, if you are using Microsoft Windows, you can enable remote diagnostic logging for the HTTP/TCP proxy by modifying the HCL OneTest API HTTP/TCP Proxy Windows service as follows:
    1. Run editProxyService.bat from an Administrator command prompt.

      The IBM RIT HTTP Proxy Properties window is displayed.

    2. Click the Java tab.
    3. Under Java Options on the Java tab, find the following default Java parameters:
      -Djava.util.logging.config.file=<HCL Quality Server installation directory>\httptcp\logging.properties
      -Djava.net.preferIPv4Stack=true
      -Djava.net.preferIPv6Address=false
      Add the following new parameters under the default Java parameters:
      -Dgreenhat.logappender.net.NET=level:DEBUG
      -Dgreenhat.logappender.jul.JUL
      Note: For information about variations of these parameters, refer to Table 2.
    4. Optionally, modify Level on the Logging tab to change the logging level related to the service itself. The default is Error.
    5. Click OK.
    6. Restart the Windows service. For example, open the Services applet in Control Panel and restart the HCL OneTest API HTTP/TCP Proxy Windows service.

Results

If you are using Microsoft Windows, HTTP/TCP proxy log files are stored in specific locations as shown in the following table:
Table 3. Locations on Microsoft Windows systems where HTTP/TCP proxy logs are stored
Log type Default location
Process C:\Users\<User name>\ghproxy
Service C:\Windows\System32\config\systemprofile\ghproxy
Note: The locations of the log files depend on settings in the logging.properties file in <HCL Quality Server installation directory>\httptcp.