Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

It does not seem possible to log explicitly in UTC (if TZ is set differently) #1004

Closed
sjmudd opened this issue Nov 4, 2019 · 2 comments · Fixed by #1017
Closed

It does not seem possible to log explicitly in UTC (if TZ is set differently) #1004

sjmudd opened this issue Nov 4, 2019 · 2 comments · Fixed by #1017
Assignees

Comments

@sjmudd
Copy link
Collaborator

sjmudd commented Nov 4, 2019

I would prefer my apps to log in UTC to avoid issues around summer/winter time changes but right now some servers are configured with a non-UTC timezone.

I tried starting up orchestrator with TZ=utc but this does not seem to modify the logging behaviour. It would be good to take this into account or allow me to provide a command line option to request orchestrator log in UTC directly.

I also notice that of all the logging most of it uses "github.com/openark/golib/log" except one place which uses "log" directly: https://github.com/github/orchestrator/blob/master/go/raft/file_snapshot.go#L12. This seems somewhat odd as it means logging will not be consistent.

Neither of these issues is critical but it might be nice to ensure that logging is consistent and that there is a way that I can force logging to be in UTC even if the system timezone is not UTC. I notice that log.SetFlags from package "log" has a flag LUTC precisely to set logging in UTC.

@shlomi-noach
Copy link
Collaborator

thank you -- I'll look into it.

@shlomi-noach shlomi-noach self-assigned this Nov 4, 2019
@jfudally jfudally self-assigned this Nov 5, 2019
@jfudally
Copy link
Contributor

jfudally commented Nov 5, 2019

@shlomi-noach I can look into this.

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

Successfully merging a pull request may close this issue.

3 participants