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

To facilitate troubleshooting, HCL DevOps Test Virtualization Control Panel (Test Virtualization Control Panel) administrators can view, download, and share detailed log events information for the HTTP/TCP proxy. The capability to display this information in Test Virtualization Control Panel requires enabling remote diagnostic logging for the proxy.

About this task

Test Virtualization Control Panel can display a diagnostic log that is a centralized view of log events of HCL DevOps Test Integrations and APIs (Test Integrations and APIs) proxies.

By default, remote diagnostic logging to Test Virtualization Control Panel is not enabled in Test Integrations and APIs Agent or in the proxies supplied with Test Virtualization Control Panel.

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 Test Virtualization Control Panel 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 <Test Virtualization Control Panel 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 DevOps Test API 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 Test Virtualization Control Panel. By default, those settings are selected in 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 Test Virtualization Control Panel
      To: Change startup.bat as follows: Change startup.sh as follows:

      Enable remote diagnostic logging at debug level to Test Virtualization Control Panel.

      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 Test Virtualization Control Panel 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 Test Virtualization Control Panel.

      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 Test Virtualization Control Panel.

      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 Test Virtualization Control Panel.
  2. Alternatively, if you are using Microsoft Windows, you can enable remote diagnostic logging for the HTTP/TCP proxy by modifying the DevOps Test API Proxy Windows service as follows:
    1. Run editProxyService.bat from an Administrator command prompt.

      The DevOps Test API 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=<Test Virtualization Control Panel 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 DevOps Test API 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 <Test Virtualization Control Panel installation directory>\httptcp.