dendrite icon indicating copy to clipboard operation
dendrite copied to clipboard

Dendrite doesn't respect system timezone for logging

Open soda-pop-ice-cream opened this issue 2 years ago • 2 comments

Background information

  • Dendrite version or git SHA: 0.8.5
  • Monolith or Polylith?: Monolith
  • SQLite3 or Postgres?: Postgres
  • Running in Docker?: No
  • go version: go version go1.18.1 linux/arm64
  • Client used (if applicable): Any

Description

  • What is the problem: Dendrite doesn't respect system timezone and write logs with UTC timezone
  • Who is affected: Server admin
  • How is this bug manifesting: Logs being written with UTC timezone
  • When did this first appear: Always have been

Steps to reproduce

  • Start server with any timezone except UTC and watch log files (STDOUT logs respect system timezone, log files doesn't )

soda-pop-ice-cream avatar May 14 '22 04:05 soda-pop-ice-cream

This seems to be intentional. I have no idea why.

https://github.com/matrix-org/dendrite/blob/6af35385ba06f75610396b91452cbf381c1f5443/internal/log.go#L35-L42

We should make that configurable.

neilalexander avatar May 15 '22 21:05 neilalexander

This seems to be intentional. I have no idea why.

https://github.com/matrix-org/dendrite/blob/6af35385ba06f75610396b91452cbf381c1f5443/internal/log.go#L35-L42

We should make that configurable.

Log files are usually considered in the same way as databases, where time information is always entered in UTC form, to allow a client anywhere in the world to translate the time information using the offset of the time zone in which the geolocation makes it believe it is located.

ealib avatar May 18 '22 06:05 ealib

We have no plans to make this configurable at this time. Generally UTC is preferred, particularly when debugging from log files sent to you from people all over the world, otherwise xreffing with other data sources (metrics, bug reports, etc) becomes hard.

kegsay avatar Dec 06 '22 14:12 kegsay