Skip to content

Commit 459839d

Browse files
authored
Merge pull request #157 from contentful-labs/MEC-1478-fix-logger-setup
feat: MEC-1478 assign logger
2 parents f6e28c0 + 85a959a commit 459839d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.go

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
4444
ctrl "sigs.k8s.io/controller-runtime"
4545
"sigs.k8s.io/controller-runtime/pkg/cache"
46+
"sigs.k8s.io/controller-runtime/pkg/log"
4647
"sigs.k8s.io/controller-runtime/pkg/log/zap"
4748
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
4849
// +kubebuilder:scaffold:imports
@@ -159,6 +160,7 @@ func realMain() int {
159160
EncodeCaller: zapcore.ShortCallerEncoder,
160161
}
161162
logger := zap.New(zap.Encoder(zapcore.NewJSONEncoder(logCfg)), zap.StacktraceLevel(uzap.PanicLevel))
163+
log.SetLogger(logger)
162164

163165
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
164166
Scheme: scheme,

0 commit comments

Comments
 (0)