Skip to content

Commit

Permalink
log structured, use RFC3339 formatting (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkarlsen authored Sep 20, 2022
1 parent c7fe20d commit c683bab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"flag"
"go.uber.org/zap/zapcore"
"log"
"os"
"strings"
Expand Down Expand Up @@ -61,7 +62,9 @@ func main() {
"Enabling this will ensure there is only one active controller manager.")
flag.Parse()

ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
ctrl.SetLogger(zap.New(zap.UseDevMode(true), zap.JSONEncoder(func(encoderconfig *zapcore.EncoderConfig) {
encoderconfig.EncodeTime = zapcore.RFC3339TimeEncoder
})))

namespace := os.Getenv("WATCH_NAMESPACE")
options := ctrl.Options{
Expand Down

0 comments on commit c683bab

Please sign in to comment.