diff --git a/Makefile b/Makefile index e01e3b0fc..f44cd766a 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,7 @@ build: generate code/gofumpt vet ## Build manager binary. .PHONY: run run: manifests generate code/gofumpt vet ## Run a controller from your host. - go run ./main.go + go run ./main.go --zap-devel=true ##@ Deployment diff --git a/main.go b/main.go index 38544f3e4..719b9d21b 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,8 @@ import ( "strings" "syscall" + uberzap "go.uber.org/zap" + "go.uber.org/zap/zapcore" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/webhook" @@ -90,8 +92,11 @@ func main() { "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") flag.StringVar(&pprofAddr, "pprof-addr", ":8888", "The address to expose the pprof server. Empty string disables the pprof server.") + + logCfg := uberzap.NewProductionEncoderConfig() + logCfg.EncodeTime = zapcore.ISO8601TimeEncoder opts := zap.Options{ - Development: true, + Encoder: zapcore.NewConsoleEncoder(logCfg), } opts.BindFlags(flag.CommandLine) flag.Parse()