Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Unify and split logging into levels to reduce log flooding in production #195

Merged

Conversation

pmacik
Copy link
Contributor

@pmacik pmacik commented Oct 7, 2019

The operator logs everything to console with the info level of verbosity - incl. information that should be logged on the debug level. That not only makes the log too verbose and unreadable but generally has a significant impact on performance and footprint.

That's why the logging should be split into various levels (such as Error, Warning, Info, Debug, Trace... ( https://dave.cheney.net/2015/11/05/lets-talk-about-logging )) and only use levels Info and below in the "production".

This PR:

@sbose78
Copy link
Member

sbose78 commented Oct 7, 2019

Good one!

@Avni-Sharma
Copy link
Contributor

/test e2e

@codecov
Copy link

codecov bot commented Oct 9, 2019

Codecov Report

Merging #195 into master will increase coverage by 0.13%.
The diff coverage is 63.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
+ Coverage   63.22%   63.36%   +0.13%     
==========================================
  Files          13       13              
  Lines         862      868       +6     
==========================================
+ Hits          545      550       +5     
- Misses        241      242       +1     
  Partials       76       76
Impacted Files Coverage Δ
pkg/controller/servicebindingrequest/common.go 69.23% <ø> (ø) ⬆️
pkg/controller/servicebindingrequest/watch.go 0% <0%> (ø) ⬆️
.../controller/servicebindingrequest/sbrcontroller.go 0% <0%> (ø) ⬆️
pkg/controller/servicebindingrequest/reconciler.go 67.34% <63.15%> (ø) ⬆️
pkg/controller/servicebindingrequest/olm.go 67.82% <64%> (+0.86%) ⬆️
pkg/controller/servicebindingrequest/mapper.go 78.57% <66.66%> (ø) ⬆️
pkg/controller/servicebindingrequest/binder.go 69.1% <80%> (+0.35%) ⬆️
pkg/controller/servicebindingrequest/planner.go 86.11% <83.33%> (ø) ⬆️
...kg/controller/servicebindingrequest/annotations.go 88.33% <87.5%> (ø) ⬆️
pkg/controller/servicebindingrequest/retriever.go 79.32% <90.32%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a1f5f8...9030102. Read the comment docs.

…ocal make target to pass it to the operator.
@pmacik
Copy link
Contributor Author

pmacik commented Oct 10, 2019

/test lint

@pmacik pmacik changed the title [WIP] Unify and split logging into levels to reduce log flooding in production Unify and split logging into levels to reduce log flooding in production Oct 10, 2019
Copy link
Member

@otaviof otaviof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the comments, it looks a lot cleaner than before. Thanks, @pmacik!

@otaviof
Copy link
Member

otaviof commented Oct 12, 2019

/lgtm

@sbose78
Copy link
Member

sbose78 commented Oct 13, 2019

/lgtm
/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbose78

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 77d8d8a into redhat-developer:master Oct 14, 2019
akashshinde added a commit to akashshinde/service-binding-operator that referenced this pull request Oct 14, 2019
* origin/master:
  Unify and split logging into levels to reduce log flooding in production (redhat-developer#195)
  Fix operator uninstallers in example commons. (redhat-developer#202)
  Add go version in go.mod (redhat-developer#201)
  Alter the Makefile commons output to be more readable (redhat-developer#198)
  update GolangCI Lint version (redhat-developer#200)
  Update golang, kubectl, and operator-sdk version to latest in CI (redhat-developer#194)
  Minor changes to improve feedback to users when running examples (redhat-developer#199)
@pmacik pmacik deleted the reduce-info-logging branch November 27, 2020 16:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants