1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-20 21:01:17 +00:00

Add timestamp to audit log (#31)

This commit is contained in:
Zlatko Čalušić 2019-01-06 15:35:59 +01:00 committed by Knut Ahlers
parent 5d6fa23377
commit 876216ee6d

View file

@ -9,6 +9,7 @@ import (
"path" "path"
"strings" "strings"
"sync" "sync"
"time"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -49,6 +50,7 @@ func (a *auditLogger) Log(event auditEvent, r *http.Request, extraFields map[str
// Compile log event // Compile log event
evt := map[string]interface{}{} evt := map[string]interface{}{}
evt["timestamp"] = time.Now().Format(time.RFC3339)
evt["event_type"] = event evt["event_type"] = event
evt["remote_addr"] = a.findIP(r) evt["remote_addr"] = a.findIP(r)