Search code examples
ignite

Ignite logging timestamp different with OS system clocktime(ignite use wrong timezone?)


My ignite dumpped log have different timestamp(timezone?) with my OS system clocktime:

Ignite Log:

[04:02:51,119][INFO][tcp-disco-sock-reader-#10][TcpDiscoverySpi] Started serving remote node connection [rmtAddr=/192.168.28.163:41705, rmtPort=41705]
[04:02:51,126][INFO][tcp-disco-sock-reader-#10][TcpDiscoverySpi] Finished serving remote node connection [rmtAddr=/192.168.28.163:41705, rmtPort=41705
[04:02:51,172][INFO][tcp-disco-sock-reader-#8][TcpDiscoverySpi] Finished serving remote node connection [rmtAddr=/192.168.28.162:42526, rmtPort=42526
[04:02:51,201][INFO][tcp-disco-srvr-#2][TcpDiscoverySpi] TCP discovery accepted incoming connection [rmtAddr=/192.168.28.163, rmtPort=34146]
[04:02:51,201][INFO][tcp-disco-srvr-#2][TcpDiscoverySpi] TCP discovery spawning a new thread for connection [rmtAddr=/192.168.28.163, rmtPort=34146]
[04:02:51,202][INFO][tcp-disco-sock-reader-#11][TcpDiscoverySpi] Started serving remote node connection [rmtAddr=/192.168.28.163:34146, rmtPort=34146]
[04:02:51,208][INFO][disco-event-worker-#101][GridDiscoveryManager] Added new node to topology: TcpDiscoveryNode [id=074891f6-2e53-415c-85f5-3f3896fe5c47, addrs=[0:0:0:0:0:0:0:1%lo, 127.0.0.1, 192.168.28.163], sockAddrs=[/0:0:0:0:0:0:0:1%lo:47500, /127.0.0.1:47500, /192.168.28.163:47500], discPort=47500, order=5, intOrder=4, lastExchangeTime=1526371371120, loc=false, ver=2.4.0#20180305-sha1:aa342270, isClient=false]
[04:02:51,209][INFO][disco-event-worker-#101][GridDiscoveryManager] Topology snapshot [ver=5, servers=3, clients=0, CPUs=96, offheap=210.0GB, heap=30.0GB]
[04:02:51,209][INFO][disco-event-worker-#101][GridDiscoveryManager] Data Regions Configured:
[04:02:51,209][INFO][disco-event-worker-#101][GridDiscoveryManager]   ^-- default [initSize=10.0 GiB, maxSize=70.0 GiB, persistenceEnabled=true]
[04:03:28,673][INFO][grid-timeout-worker-#71][IgniteKernal] 
Metrics for local node (to disable set 'metricsLogFrequency' to 0)
    ^-- Node [id=f687a6b6, uptime=00:01:00.007]
    ^-- H/N/C [hosts=3, nodes=3, CPUs=96]
    ^-- CPU [cur=0.33%, avg=0.11%, GC=0%]
    ^-- PageMemory [pages=0]
    ^-- Heap [used=80MB, free=99.22%, comm=10240MB]
    ^-- Non heap [used=49MB, free=-1%, comm=50MB]
    ^-- Outbound messages queue [size=0]
    ^-- Public thread pool [active=0, idle=2, qSize=0]
    ^-- System thread pool [active=0, idle=7, qSize=0]

But my OS clocktime is:

[root@test3 apache-ignite]# cd /var/log/apache-ignite/
[root@test3 apache-ignite]# ls -trl
-rw-r--r-- 1 ignite ignite       0 May 15 16:02 ignite-074891f6.0.log.lck
-rw-r--r-- 1 ignite ignite    5336 May 15 16:05 apache-ignite-gc.log.0.current
-rw-r--r-- 1 ignite ignite   20282 May 15 16:14 ignite-074891f6.0.log
[root@test3 apache-ignite]# date
Tue May 15 16:15:02 CST 2018

How could change the ignite runing time to the local timezone?


Solution

  • Timezone can be specified as a JVM parameter. Take a look at the following question: How to set a JVM TimeZone Properly

    You can also change timezone of logged timestamp in logger configuration. For example, if you use the following timestamp format for Log4J, it will be printed in GMT+0 timezone:

    %d{ISO8601}{GMT+0}