Changing time zone settings on Linux

About this task

On Linux®, by default, IBM® Spectrum Symphony components use GMT time when messages are logged regardless of the local time setting on Linux machines.

To change the time zone to your local time setting, change the component_name.log4j.properties files on each Linux host in the $SOAM_HOME/conf directory.

For example, to change the log4j.properties file for session manager:

Procedure

  1. Open the ssm.log4j.properties file.
  2. Uncomment one of the following lines to set your time zone:
    #log4j.appender.SSM.layout.TimeZone=Canada/Eastern
    #log4j.appender.SSM.layout.TimeZone=PRC
    #log4j.appender.SSM.layout.TimeZone=Europe/Paris
    #log4j.appender.SSM.layout.TimeZone=Europe/London
    #log4j.appender.SSM.layout.TimeZone=EST
    
  3. Uncomment one of the following lines to set the output format with your time zone.
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q Canada/Eastern} %p [${log4cxx_pid}:%t] %c - %m%n
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q PRC} %p [${log4cxx_pid}:%t] %c - %m%n
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q Europe/Paris} %p [${log4cxx_pid}:%t] %c - %m%n
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q Europe/London} %p [${log4cxx_pid}:%t] %c - %m%n
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q EST} %p [${log4cxx_pid}:%t] %c - %m%n
    
  4. Save the file.

    Your file should now look similar to the following example configuration, where the lines to set the time zone to EST have been uncommented:

    ...
    #Pattern to output the caller's file name and line number.
    log4j.appender.SSM=org.apache.log4j.RollingFileAppender
    #log4j.appender.SSM.File=${SOAM_HOME}/logs/ssm.${log4cxx_hostname}.log
    log4j.appender.SSM.File=${SOAM_HOME}/logs/ssm.${log4cxx_hostname}.${log4cxx_appname}.log
    log4j.appender.SSM.MaxFileSize=100000KB
     
    #Time Zone Setting
    #choose your time zone
    #for example, for Canada Eastern time, use Canada/Eastern or EST
    #log4j.appender.SSM.layout.TimeZone=Canada/Eastern
    #log4j.appender.SSM.layout.TimeZone=PRC
    #log4j.appender.SSM.layout.TimeZone=Europe/Paris
    #log4j.appender.SSM.layout.TimeZone=Europe/London
    log4j.appender.SSM.layout.TimeZone=EST
     
    # Keep one backup file
    log4j.appender.SSM.MaxBackupIndex=10
    log4j.appender.SSM.layout=org.apache.log4j.PatternLayout
    #if you use the timezone setting in Windows, please use this pattern
    log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q %Z} %p [${log4cxx_pid}:%t] %c - %m%n
    #if you use the timezone setting in Linux, please use this pattern (replace %Z with your time zone)
    #for example, if your time zone is EST, replace %Z with EST, if other time zones, please replace %Z with others
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q Canada/Eastern} %p [${log4cxx_pid}:%t] %c - %m%n
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q PRC} %p [${log4cxx_pid}:%t] %c - %m%n
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q Europe/Paris} %p [${log4cxx_pid}:%t] %c - %m%n
    #log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q Europe/London} %p [${log4cxx_pid}:%t] %c - %m%n
    log4j.appender.SSM.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%Q EST} %p [${log4cxx_pid}:%t] %c - %m%n
    ..