From ebbc02d51b0146ca79622742f7baaba97fd26581 Mon Sep 17 00:00:00 2001 From: Craig Miskell Date: Fri, 11 Sep 2020 04:41:02 +0000 Subject: Change timeformat to not omit trailing 0s Per https://golang.org/pkg/time/#Time.Format: "If the fraction in the layout is 9s, trailing zeros are dropped." With 9's, at the top of the second the time printed in logs goes from something like: 2020-09-07 01:02:03.999Z to 2020-09-07 01:02:04Z then back to 2020-09-07 01:02:04.001Z This can be problematic for parsers (e.g. fluentd) which assume a consistent format including the milliseconds (currently we're dropping about 1/1000 of the gitaly logs on gitlab.com because of this). By using 0s in the format string we always get the sub-second portion, and log parsing will be kept happier --- changelogs/unreleased/always-include-ms-in-logs.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/always-include-ms-in-logs.yml (limited to 'changelogs') diff --git a/changelogs/unreleased/always-include-ms-in-logs.yml b/changelogs/unreleased/always-include-ms-in-logs.yml new file mode 100644 index 000000000..41674b04b --- /dev/null +++ b/changelogs/unreleased/always-include-ms-in-logs.yml @@ -0,0 +1,5 @@ +--- +title: Change timeformat to not omit trailing 0s +merge_request: 256 +author: +type: fixed -- cgit v1.2.3