Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

By default, the DataSync Agent will log produce logs in the timezone of server that is running the agent. You can change the timezone manually by modifying the log4j2.xml file in the conf directory.

Prerequisites


(warning) First, you will need to set up one of the Perspectium DataSync Agents.

(warning) Then, you should stop running your DataSync Agent before making any Agent configuration changes.

Procedure

To change the timezone in the agents logs, follow these steps:


UI Steps


UI Step

Open your log4j2.xml

Navigate to the your DataSync Agent and go to the conf directory


UI Step

Add a timezone to the RollingRandomAccessFile

Within the <RollingRandomAccessFile> directive find the <PatternLayout> directive and add your preferred timezone to the <Pattern> directive. 

For example: 

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Appenders>
        <Console name="CONSOLE" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p - %t - %c{1} - %m%n"/>
        </Console>
        <RollingRandomAccessFile name="FILE" fileName="logs/perspectium.log"
                filePattern="logs/perspectium-%d{MM-dd-yyyy}-%i.log.gz">
            <PatternLayout> 
            	<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}{America/New_York} %-5p - %t - %c{1} - %m%n</Pattern>
            </PatternLayout>
            <Policies>
                <TimeBasedTriggeringPolicy />
                <SizeBasedTriggeringPolicy size="20 MB"/>
            </Policies>
            <DefaultRolloverStrategy max="14"/>
        </RollingRandomAccessFile>
        <Async name="ASYNC">
            <AppenderRef ref="FILE"/>
            <AppenderRef ref="CONSOLE"/>
        </Async>
    </Appenders>
    <Loggers>
        <logger name="org.apache.http" level="error" additivity="false">
            <AppenderRef ref="ASYNC"/>
        </logger>
        <logger name="com.perspectium.db" level="info">
            <AppenderRef ref="ASYNC"/>
        </logger>
        <logger name="org.springframework" level="info">
            <AppenderRef ref="ASYNC"/>
        </logger>
        <Root level="info">
            <AppenderRef ref="ASYNC"/>
        </Root>
    </Loggers>
</Configuration>

Notice in the <Pattern> directive has  \{America/New_York\} tag has been added.


UI Step

Save your conf.xml and restart your agent




You can see a list of timezones here under the TZ database name column.

Similar topics


Content by Label
showLabelsfalse
max5
showSpacefalse
sortmodified
cqllabel = "data-sync" and space = currentSpace()

Contact Perspectium Support


US: 1 888 620 8880

UK: 44 208 068 5953

support@perspectium.com