Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging timestamps changed from local time to UTC #3130

Open
michaelsproul opened this issue Mar 30, 2022 · 8 comments
Open

Logging timestamps changed from local time to UTC #3130

michaelsproul opened this issue Mar 30, 2022 · 8 comments
Labels

Comments

@michaelsproul
Copy link
Member

Description

In Lighthouse v2.1.4 and later, logging timestamps changed from being in local time to UTC. This was due to an update to our logging library slog-term in a routine dependency bump PR (#3039). Upstream slog-term set all timestamps to UTC to prevent a race condition in one of their dependencies.

We are following slog-rs/term#44 for a resolution, and would prefer not to revert to the previous racey version of slog-term.

@michaelsproul michaelsproul pinned this issue Mar 30, 2022
@ieggel
Copy link

ieggel commented Mar 30, 2022

@michaelsproul
Maybe you could just disable slog-term logging the time altogether, at least for systemd logs? If i remember right in systemd logs before v2.4.1 there was only the time by systemd. Now time gets logged twice on the same log line, once by systemd and once by lighthouse.

@michaelsproul
Copy link
Member Author

We have an issue open to track that feature here: #3101

@mining-visualizer
Copy link

mining-visualizer commented Apr 14, 2022

I hope that something can be done about this. I much prefer having log files in my local time zone.

@AgeManning
Copy link
Member

We have opted to use UTC by default as most events a relative in time and this helps debugging logs across multiple timezones.

@lg
Copy link

lg commented Feb 26, 2024

fyi this decision is pretty non-standard. most other applications will use the timezone of the machine (which could be in UTC for situations like what you describe).

@michaelsproul
Copy link
Member Author

I was advocating for keeping UTC because I've found it's nice to not have to worry about what timezones users are using when they send me logs. This is mostly useful for comparing log timestamps against the starts of specific slots (e.g. from a tool like https://slots.symphonious.net/).

I realise this is a bit selfish on my part though, and I could deal with localtime logs. It's usually possible to infer the timezone, and doing a bit of manual conversion between user timezone <> UTC is bearable.

UTC has other benefits (no DST), but maybe it should be up to the user to opt-in, rather than us forcing it on them. As you say, many operators will know about running servers on UTC, and we could encourage community guides like Somer's & CoinCashew to recommend UTC as well.

@AgeManning
Copy link
Member

AgeManning commented Feb 26, 2024

Yes, this decision was assuming that there were no users that wanted local time. If users are interested in using local time we can re-open this issue and add the option for localtime or option for UTC.

@lg
Copy link

lg commented Feb 26, 2024

would definitely be interested in localtime and would incredibly appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants