From 2939a9fd1a2034e3d4f60157d55ad1e6fbe770d9 Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Mon, 4 Jun 2018 16:37:50 +0100 Subject: [PATCH] Use string value for pid in JSON log (#110) --- internal/logger/logger.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 6e9b5aa..c2b2a5a 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -23,6 +23,7 @@ import ( "io" "os" "os/user" + "strconv" "sync" "time" ) @@ -40,7 +41,7 @@ type Logger struct { debug bool json bool processName string - pid int + pid string serverName string host string user *user.User @@ -62,7 +63,7 @@ func NewLogger(writer io.Writer, debug bool, json bool, serverName string) (*Log debug: debug, json: json, processName: os.Args[0], - pid: os.Getpid(), + pid: strconv.Itoa(os.Getpid()), serverName: serverName, host: hostname, user: user,