Add function for ISO 8601.3 timestamp formatting
Problem to solve
Under &2575 we are standardizing all log timestamps to ISO 8601.3 format (ISO 8601 with millisecond precision, like "2018-05-23T11:14:50.456Z"). Currently log entries for Gitaly and Pages (which both depend on labkit
) use ordinary ISO 8601 format for timestamps (without second precision, like "2018-05-23T11:14:50Z"). It would be ideal if labkit
provided a function to format timestamps in ISO 8601.3 that could be used for logging.
Proposal
"add a function in gitlab https://gitlab.com/gitlab-org/labkit/blob/master/log/logger_options.go like WithTimestamp, and from there it is trivial to change the timestamp [in implementation issues]" (per @leolara).
Note: The implementation issues would be:
- gitaly #2432
- gitlab-shell TBD (see MR #361)
- pages #149
(This has been suggested by by @leolara, by @zj-gitlab and by @aakriti.gupta.)