common icon indicating copy to clipboard operation
common copied to clipboard

Unify structured logging for common operator

Open Jeffwan opened this issue 3 years ago • 2 comments

All of below have reference in different operators. This makes logs very messy and we need to consolidate to one common utility

  1. "github.com/sirupsen/logrus"
  2. "github.com/go-logr/logr" - default logger interface used by reconciler generated by kubebuilder.
  3. "sigs.k8s.io/controller-runtime/pkg/log" - implementation of "go-logr/logr"
  4. https://github.com/kubeflow/common/blob/master/pkg/util/logger.go - use logrus underneath
  5. "k8s.io/klog"

Jeffwan avatar Jul 11 '21 00:07 Jeffwan

Do we have any preference in those log libraries? @Jeffwan

PatrickXYS avatar Aug 06 '21 00:08 PatrickXYS

@PatrickXYS We do prefer json logging. No big preference. The challenge is different components use different solutions

  • kubebuilder
  • logrus

Let's see if we can consolidate into one

Jeffwan avatar Aug 06 '21 01:08 Jeffwan