From 7ce20f125289e19f6144fdf6be81bd9ef8d436ac Mon Sep 17 00:00:00 2001 From: Binaek Sarkar Date: Mon, 17 Jul 2023 17:00:55 +0530 Subject: [PATCH] do not include zero timestamp in log --- client.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index a6a9ffa2..3eee093b 100644 --- a/client.go +++ b/client.go @@ -1047,8 +1047,11 @@ func (c *Client) logStderr(r io.Reader) { } } else { out := flattenKVPairs(entry.KVPairs) - - out = append(out, "timestamp", entry.Timestamp.Format(hclog.TimeFormat)) + if !entry.Timestamp.IsZero() { + // no point in including a zero timestamp + // this can happen if the upstream logger has DisableTime set to true + out = append(out, "timestamp", entry.Timestamp.Format(hclog.TimeFormat)) + } switch hclog.LevelFromString(entry.Level) { case hclog.Trace: l.Trace(entry.Message, out...)