Use string value for pid in JSON log (#110)
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -40,7 +41,7 @@ type Logger struct {
|
|||||||
debug bool
|
debug bool
|
||||||
json bool
|
json bool
|
||||||
processName string
|
processName string
|
||||||
pid int
|
pid string
|
||||||
serverName string
|
serverName string
|
||||||
host string
|
host string
|
||||||
user *user.User
|
user *user.User
|
||||||
@@ -62,7 +63,7 @@ func NewLogger(writer io.Writer, debug bool, json bool, serverName string) (*Log
|
|||||||
debug: debug,
|
debug: debug,
|
||||||
json: json,
|
json: json,
|
||||||
processName: os.Args[0],
|
processName: os.Args[0],
|
||||||
pid: os.Getpid(),
|
pid: strconv.Itoa(os.Getpid()),
|
||||||
serverName: serverName,
|
serverName: serverName,
|
||||||
host: hostname,
|
host: hostname,
|
||||||
user: user,
|
user: user,
|
||||||
|
|||||||
Reference in New Issue
Block a user