k8ssandra-operator icon indicating copy to clipboard operation
k8ssandra-operator copied to clipboard

Set verbosity level in logging statements

Open jsanda opened this issue 3 years ago • 3 comments

What is missing? Most (maybe all) logging throughout the operator are done with logger.Info() and logger.Error(). A verbosity should be set for each statement, e.g., logger.V(5).Info().

Why do we need it? As the code base has grown there is a lot more logging output from the operator. A lot of the log statements are really only needed during dev/testing or debugging. By setting verbosity levels we give the user the ability to configure and tune logging output.

This is critical from a usability standpoint IMO.

It probably makes sense to configure the logging level via the operator configuration which means we need to do #63.

Environment

  • K8ssandra Operator version:
v1.0.0-alpha.2

┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: K8OP-120

jsanda avatar Jan 10 '22 21:01 jsanda

Kubernetes recommends max V(1) for debugging, not deeper.

burmanm avatar Jan 11 '22 04:01 burmanm

Can you provide a reference?

So nothing greater than V(1)?

jsanda avatar Jan 11 '22 15:01 jsanda

Here are logging guidelines for kubernetes dev docs https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md. It suggests V(4) for debug and a default level of V(2).

jsanda avatar Jan 11 '22 15:01 jsanda