From 3d11c34b381d9eadd5b7e73109c880c402632e70 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Tue, 6 Apr 2021 14:14:48 +0100 Subject: [PATCH] Add ns time precision to log output. --- cmd/chirpstack-application-server/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/chirpstack-application-server/main.go b/cmd/chirpstack-application-server/main.go index 1334580fa..d97a2f32f 100644 --- a/cmd/chirpstack-application-server/main.go +++ b/cmd/chirpstack-application-server/main.go @@ -1,6 +1,8 @@ package main import ( + "time" + log "github.com/sirupsen/logrus" "google.golang.org/grpc/grpclog" @@ -49,6 +51,10 @@ func (gl *grpcLogger) Infof(format string, args ...interface{}) { } func init() { + log.SetFormatter(&log.TextFormatter{ + TimestampFormat: time.RFC3339Nano, + }) + grpclog.SetLoggerV2(&grpcLogger{log.StandardLogger()}) }