Applications Systems

Changing DPA to write logs using the UTC time zone

By default, DPA uses the time zone set on the DPA server for timestamps in logs. You can change it to use the UTC time zone.

First published date

8/18/2020 10:38 PM

Last published date

11/9/2020 9:17 PM

Overview

This article applies to DPA 2020.2 and earlier. By default, DPA enters the time in log files using the time zone that is set on the DPA server. See the following instructions if you would prefer that the DPA use the UTC time zone.

Product section

Database Performance Analyzer

Resolution

You can change the following files to use the UTC time zone:

Changing DPA .log files to UTC

Depending on your version of DPA, complete one of the following tasks to change DPA log files to use UTC instead of your DPA server time zone.

DPA 2020.4 and later

  1. Open the following file in a text editor:

    <DPA_INSTALLATION>\iwc\tomcat\webapps\iwc\WEB-INF\classes\log4j2.xml

  2. Find this text: <Property name="patternLog">
  3. On the same line, replace %date{ISO8601_OFFSET_DATE_TIME_HHMM} with the following:

    %date{ISO8601_OFFSET_DATE_TIME_HHMM}{GMT+0}

    Note: If you want the logs to use a time zone other than UTC, change the GMT+0 to GMT+X or GMT-X where X is the number of hours difference between UTC and the time zone you want the logs to use.

  4. Restart DPA to apply the change.

DPA 2020.2 and earlier

  1. Download the log4j1.2 extras library:

    http://www.apache.org/dyn/closer.cgi/logging/log4j/extras/1.2.17/apache-log4j-extras-1.2.17-bin.zip

  2. Extract the file and copy apache-log4j-extras-1.2.17.jar to the following location:

    <DPA_INSTALLATION>\iwc\tomcat\webapps\iwc\WEB-INF\lib

    By default, the DPA installation directory is C:\Program Files\SolarWinds\DPA.

  3. Make a backup of <DPA_INSTALLATION>\iwc\tomcat\webapps\iwc\WEB-INF\classes\log4j.xml.
  4. Open the log4j.xml file in text editor and make the following changes: 
    • Replace all occurrences of apache.log4j.PatternLayout with org.apache.log4j.EnhancedPatternLayout to use the pattern layout from the extras library.
    • Replace all occurrences of %d{ISO8601}.%d{zzz} with %d{ISO8601}{GMT} to log in ISO format using the GMT (UTC) time zone.
  5. Restart DPA to apply the change.

Changing DPA .csv files to UTC

Follow these steps to change DPA .csv files to use UTC instead of the time zone of your DPA server. 

Note: If you want to change both .csv files and DPA's Tomcat logs to UTC, see the following section. 

WARNING: This change also affects the time zone that DPA uses when it stores monitoring data to tables in the DPA repository database. Therefore, SolarWinds recommends making this change only in new DPA installations to prevent data inconsistencies. In an existing DPA deployment, if the UTC time zone is behind the DPA server's time zone, changing to UTC will cause data in the DPA repository to have future timestamps, which might cause monitoring to stop until the difference between the previous and current time zones has passed. Also, summarized data will be off by the time zone difference, so it will be harder to correlate the old and new data collected on monitored instances.

  1. Open the following file in text editor:

    <DPA_INSTALLATION>\iwc\tomcat\ignite_config\idc\system.properties

  2. Add or update the following line:

    user.timezone=UTC

  3. Restart DPA to apply the change.

Changing DPA .csv and Tomcat log files to UTC

Complete the following steps to change DPA's Tomcat logs to use UTC instead of your server time zone. This procedure affects logs in the <DPA_INSTALLATION>\iwc\tomcat\logs folder, such as catalina.log, stderr.log, and stdout.log. This procedure also changes the .csv files to UTC. 

WARNING: This change also affects the time zone that DPA uses when it stores monitoring data to tables in the DPA repository database. Therefore, SolarWinds recommends making this change only in new DPA installations to prevent data inconsistencies. In an existing DPA deployment, if the UTC time zone is behind the DPA server's time zone, changing to UTC will cause data in the DPA repository to have future timestamps, which might cause monitoring to stop until the difference between the previous and current time zones has passed. Also, summarized data will be off by the time zone difference, so it will be harder to correlate the old and new data collected on monitored instances.

  1. Open the following file in a text editor:

    <DPA_INSTALLATION>\iwc\tomcat\ignite_config\idc\server.properties

  2. Add the value -Duser.timezone=UTC to one or both of the following properties:

    • additionalJVMOption

      This property is used when DPA runs on a Linux server or when it runs on a Windows server but is started manually instead of running as a service. 

    • windows.service.additionalJVMOption

      This property is used when DPA runs on a Windows server as a service.

  3. Apply the change:
    • If you updated the additionalJVMOption property, restart DPA to apply the change.
    • If you updated the windows.service.additionalJVMOption property, recreate the DPA Windows service (IgnitePI) to apply the change. To recreate the service, run the following commands:
      1. <DPA_INSTALLATION>\removeWindowsService.bat
      2. <DPA_INSTALLATION>\createWindowsService.bat