From 53e8f6c60d73dce2e678cc22829598a1d719694a Mon Sep 17 00:00:00 2001 From: Torkel Rogstad Date: Tue, 25 Jul 2023 14:17:01 +0200 Subject: [PATCH] logdna/adapter: use sub second precision --- logdna/adapter/adapter.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/logdna/adapter/adapter.go b/logdna/adapter/adapter.go index 97017dd..cebcf91 100644 --- a/logdna/adapter/adapter.go +++ b/logdna/adapter/adapter.go @@ -131,9 +131,11 @@ func (adapter *Adapter) Stream(logstream chan *router.Message) { ) } else { adapter.Queue <- Line{ - Line: string(messageStr), - File: m.Container.Name, - Timestamp: time.Now().Unix(), + Line: string(messageStr), + File: m.Container.Name, + // We're on a very old Go version, so can't use stdlib function + // https://stackoverflow.com/a/24122933 + Timestamp: m.Time.UnixNano() / 1e6, } } }