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
Last published date
Overview
Product section
Resolution
You can change the following files to use the UTC time zone:
- DPA .log files
- DPA .csv files (recommended only for new installations)
- DPA .csv and Tomcat .log files (recommended only for new installations)
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
-
Open the following file in a text editor:
<DPA_INSTALLATION>\iwc\tomcat\webapps\iwc\WEB-INF\classes\log4j2.xml
- Find this text: <Property name="patternLog">
-
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.
- Restart DPA to apply the change.
DPA 2020.2 and earlier
-
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
-
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.
- Make a backup of <DPA_INSTALLATION>\iwc\tomcat\webapps\iwc\WEB-INF\classes\log4j.xml.
- 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.
- 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.
-
Open the following file in text editor:
<DPA_INSTALLATION>\iwc\tomcat\ignite_config\idc\system.properties
-
Add or update the following line:
user.timezone=UTC
- 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.
-
Open the following file in a text editor:
<DPA_INSTALLATION>\iwc\tomcat\ignite_config\idc\server.properties
-
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.
-
- 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:
- <DPA_INSTALLATION>\removeWindowsService.bat
- <DPA_INSTALLATION>\createWindowsService.bat