Timezone Management within campaigns

From 12.1.9 onwards, Campaign supports timezone management within campaigns. This feature ensures that timestamps within the campaign flowchart, campaign logs, and UI elements reflect the user's selected timezone. Users can now configure the system to display logs and timestamps in their desired timezone, making it easier to troubleshoot and monitor campaigns across different regions.

Key Features
  • User-defined TimeZone - Users can set their preferred timezone in the Campaign UI.
  • Log Timestamps - All timestamps in campaign-related logs are now adjusted to the selected timezone.
  • Configurable Logging - Timezone settings can be configured via campaign_log4j.xml.
  • Support for Multiple Logs - This enhancement applies to various logs such as campaignweb.log, EngageETL.log, ETL.log, UBX.log, and null_appender.log.
Steps for Configuring TimeZone in Campaign
  1. Set TimeZone in Campaign UI - The first step is to configure the desired timezone in the Campaign UI. This ensures that timestamps throughout the campaign process align with your time zone preference.
    • Navigate to Settings > Users > Edit Preferences > .
    • Select TimeZone - Select the appropriate timezone for your location from the dropdown menu.
  2. Modify campaign_log4j.xml Configuration
    After selecting the timezone in the UI, the next step is to update the campaign_log4j.xml file. This file controls the formatting of log output, including the timestamps. For example, the following change would configure timestamps to use GMT+2:
    • Edit the PatternLayout for Timestamps: In the campaign_log4j.xml, modify the timestamp format to reflect the desired timezone. pattern="%d{MM/dd/yyyy HH:mm:ss} {GMT+2} %-5p %c{2} [%L] - %m%n" />output : 11/14/2024 14:34:56 INFO MyClass - Campaign started successfully
  3. Set environment variables -

    Set LANG and TZ environment variables for the Listener. This can be done in the setenv.bat or (.sh on Linux/AIX). This is not required for the dummy or flowchart servers. Language and timezone preferences are set automatically for acsvr processes.

  4. Restart the Server - To apply the changes, restart the Campaign Server after modifying the campaign_log4j.xml file. This ensures that the timezone configuration takes effect across all logs.

Logs Affected

This enhancement applies to the following log files, ensuring that all logs contain the appropriate timestamps based on the configured timezone:

campaignweb.log, EngageETL.log, ETL.log UBX.log, null_appender.log, listener log, flowchart logs

The following change in campaign_log4j.xml to achieve different log patterns:
Pattern Log Output Example
%d{MM/dd/yyyy HH:mm:ss}{GMT+x} 11/14/2024 14:26:00 INFO MyClass [45] - Campaign started successfully
%d{d/M/yyyy a hh:mm:ss}{GMT+x} 14/11/2024 PM 02:26:00 INFO MyClass [45] - Campaign started successfully
%d{yyyy/MM/dd HH:mm:ss}{GMT+x} 2024/11/14 14:26:00 INFO MyClass [45] - Campaign started successfully
%d{yyyy/MM/dd hh:mm:ss a}{GMT+x} 2024/11/14 02:26:00 PM INFO MyClass [45] - Campaign started successfully
%d{MM/dd/yyyy HH:mm:ss z}{GMT+x} 11/14/2024 11:19:18 GMT+02:00 INFO MyClass [45] - Campaign started successfully
Note: Here, 'x' represents the time zone of the region, and the log output will show the time in that region's local time.
Note: Date-time format of the logs in the listener and flowchart log depends on the locale and/or language preference set using UI.

The Timezone feature in Campaign provides a critical capability for managing timestamp accuracy across various logs and UI components. By following the outlined steps to configure the timezone and modify the log configuration files, users can ensure that all campaign-related activities reflect the appropriate local time, improving visibility and consistency across systems.