Skip to content

Commit c683bab

Browse files
authored
log structured, use RFC3339 formatting (#489)
1 parent c7fe20d commit c683bab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package main
1818

1919
import (
2020
"flag"
21+
"go.uber.org/zap/zapcore"
2122
"log"
2223
"os"
2324
"strings"
@@ -61,7 +62,9 @@ func main() {
6162
"Enabling this will ensure there is only one active controller manager.")
6263
flag.Parse()
6364

64-
ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
65+
ctrl.SetLogger(zap.New(zap.UseDevMode(true), zap.JSONEncoder(func(encoderconfig *zapcore.EncoderConfig) {
66+
encoderconfig.EncodeTime = zapcore.RFC3339TimeEncoder
67+
})))
6568

6669
namespace := os.Getenv("WATCH_NAMESPACE")
6770
options := ctrl.Options{

0 commit comments

Comments
 (0)