diff --git a/main.go b/main.go index c86188f..8f7d086 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,8 @@ var logstdout = log.New() var logfile = log.New() func init() { + logstdout.SetFormatter(&log.TextFormatter{ + FullTimestamp: true}) logstdout.SetOutput(os.Stdout) logstdout.SetLevel(log.WarnLevel) @@ -38,13 +40,13 @@ func runner(remoteip string, command string, args... string) string{ "remote_ip": remoteip, "command": fmt.Sprint(command, args), "error": err.Error(), - }).Warn("the following request failed:") + }).Warn("request failed:") } } else { logfile.WithFields(log.Fields{ "remote_ip": remoteip, "command": fmt.Sprint(command, args), - }).Info("the following request was issued without error") + }).Info("request succeeded:") } return string(cmd) }