logs: change timestamp to ISO (#1708)

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
This commit is contained in:
Sahil Lakhwani
2020-09-11 08:04:29 +05:30
committed by GitHub
co-authored by Vishal
parent 8c0a368969
commit 07b294778a
16 changed files with 98 additions and 28 deletions
+6 -1
View File
@@ -16,6 +16,7 @@ import (
"github.com/pkg/errors"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
const (
@@ -188,7 +189,11 @@ func readinessProbeHandler(w http.ResponseWriter, r *http.Request) {
}
func main() {
logger, err := zap.NewProduction()
config := zap.NewProductionConfig()
config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
logger, err := config.Build()
if err != nil {
log.Fatalf("can't initialize zap logger: %v", err)
}