From 876216ee6da26a29d34af089ceb86233a0adfe92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatko=20=C4=8Calu=C5=A1i=C4=87?= Date: Sun, 6 Jan 2019 15:35:59 +0100 Subject: [PATCH] Add timestamp to audit log (#31) --- audit.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audit.go b/audit.go index 7447198..690aeea 100644 --- a/audit.go +++ b/audit.go @@ -9,6 +9,7 @@ import ( "path" "strings" "sync" + "time" "github.com/pkg/errors" @@ -49,6 +50,7 @@ func (a *auditLogger) Log(event auditEvent, r *http.Request, extraFields map[str // Compile log event evt := map[string]interface{}{} + evt["timestamp"] = time.Now().Format(time.RFC3339) evt["event_type"] = event evt["remote_addr"] = a.findIP(r)