Skip to content

[NEW] Add timezone to redis logs  #12932

@ecerulm

Description

@ecerulm

The problem/use-case that the feature addresses

The redis logs include datetime / timestamps in local timezone like the one below:

26838:C 27 Oct 2024 02:30:00.000 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

the utc offset for the timezone is not included.

So for the log entry above is not possible to determine if it happened 2024-10-27 02:30:00 +0100 or "2024-10-27 02:30:00 +0200". Specially since on 2024-10-27 03:00:00 +02:00 is when the daylight saving from CEST to CET happen, so on 2024-10-27 03:00:00 +0200 changes to 2024-10-27 02:00:00 +0100.

Description of the feature

I want a new configuration parameter that enables the printing of the timezone, so when the configuration parameter is set the log format will change from

26838:C 27 Oct 2024 02:30:00.000 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

to

26838:C 27 Oct 2024 02:30:00.000+0200 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

note the +0200

Alternatives you've considered

Forcing the timezone to be UTC by setting TZ="UTC", then the timestamp can be consistently parsed since the time printed does not shift due to daylight savings.

For example

date
Wed Jan 10 15:35:04 CET 2024

TZ="UTC" redis-server
27354:C 10 Jan 2024 14:35:04.766 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

Additional information

Any additional information that is relevant to the feature request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions