dendrite
dendrite copied to clipboard
Dendrite doesn't respect system timezone for logging
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 )
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.
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.
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.