# How to set other time zone in rally's log?

**URL:** <https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [March 28, 2023, 7:52am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683 "2023-03-28T07:52:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsop\_479](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@vsop\_479](https://discuss.elastic.co/u/vsop_479)\
**Post date:** [March 28, 2023, 7:52am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/1 "2023-03-28T07:52:33Z")

</div>

Is there any way to set other time zone in rally's log?  
I tried modify the format or datefmt in logging.json, but can't figure it out.

```auto
"normal": {
      "format": "%(asctime)s,%(msecs)d %(actorAddress)s/PID:%(process)d %(name)s %(levelname)s %(message)s",
      "datefmt": "%Y-%m-%d %H:%M:%S",
      "()": "esrally.log.configure_utc_formatter"
    }

```

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [March 28, 2023, 10:01am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/2 "2023-03-28T10:01:13Z")

</div>

Hello,

As you've shown in the above snippet, the [actual function](https://github.com/elastic/rally/blob/71688bcf5175cd1330481e8021f51d9c525785e1/esrally/log.py#L29-L36) that is currently used forces the output to UTC.

Depending on what you need to do and depending on how you've installed Rally, one workaround would be to edit the file [rally/log.py at 71688bcf5175cd1330481e8021f51d9c525785e1 · elastic/rally · GitHub](https://github.com/elastic/rally/blob/71688bcf5175cd1330481e8021f51d9c525785e1/esrally/log.py#L35) and e.g. switch from `time.gmtime` to `time.local` to honor the local timezone defined on your host.

We could probably support an additional property to specify a timezone for logging; I'll create a Rally issue.

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [March 28, 2023, 10:07am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/3 "2023-03-28T10:07:14Z")

</div>

raised [Configurable timezone for Rally logging · Issue #1694 · elastic/rally · GitHub](https://github.com/elastic/rally/issues/1694)

---

<div class="post-metadata">

**Author:** ![vsop\_479](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@vsop\_479](https://discuss.elastic.co/u/vsop_479)\
**Post date:** [March 28, 2023, 11:38am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/4 "2023-03-28T11:38:42Z")

</div>

Nice, thanks for your work.

---

<div class="post-metadata">

**Author:** ![Quentin\_Pradet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quentin_pradet/32/94192_2.png) [@Quentin\_Pradet](https://discuss.elastic.co/u/Quentin_Pradet)\
**Post date:** [April 13, 2023, 7:54am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/5 "2023-04-13T07:54:18Z")

</div>

@vsop_479 Can you please share why using local time would help? Sticking to UTC [avoids a lot of complexity](https://github.com/elastic/rally/pull/1699#pullrequestreview-1382842287). So it would be interesting to know about your use case.

---

<div class="post-metadata">

**Author:** ![vsop\_479](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@vsop\_479](https://discuss.elastic.co/u/vsop_479)\
**Post date:** [April 20, 2023, 11:57am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/6 "2023-04-20T11:57:31Z")

</div>

The time in rally.log is different to host time, which just makes reading log inconvenient.  
It seems complex to support configuable timezone in rally.

---

<div class="post-metadata">

**Author:** ![vsop\_479](https://avatars.discourse-cdn.com/v4/letter/v/6f9a4e/32.png) [@vsop\_479](https://discuss.elastic.co/u/vsop_479)\
**Post date:** [April 20, 2023, 11:58am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/7 "2023-04-20T11:58:24Z")

</div>

The time in rally.log is different to host time, which just makes reading log inconvenient.  
It seems complex to support configuable timezone in rally.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 18, 2023, 11:58am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/8 "2023-05-18T11:58:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Quentin\_Pradet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quentin_pradet/32/94192_2.png) [@Quentin\_Pradet](https://discuss.elastic.co/u/Quentin_Pradet)\
**Post date:** [June 13, 2023, 6:13am UTC](https://discuss.elastic.co/t/how-to-set-other-time-zone-in-rallys-log/328683/9 "2023-06-13T06:13:49Z")

</div>

This is now part of Rally 2.8.0. Thanks!
