Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the logs written by default during reconciliation #638

Open
leochr opened this issue Oct 11, 2024 · 2 comments
Open

Reduce the logs written by default during reconciliation #638

leochr opened this issue Oct 11, 2024 · 2 comments
Assignees

Comments

@leochr
Copy link
Member

leochr commented Oct 11, 2024

Reduce the logs written by default during reconciliation.

By default, print only the errors. Stack traces should be printed only for debug mode.

Introduce log level(s) for additional logging statements (i.e. Debug or Fine/Finer/Finest). Log level could be set as an env variable in Subscription (or in Operator's ConfigMap).

@leochr
Copy link
Member Author

leochr commented Oct 11, 2024

FYI @kabicin

@idlewis
Copy link
Member

idlewis commented Nov 18, 2024

In the sample log file, there were lots of
INFO utils Reconciled {"Kind":....
messages. These should def. be debug messages. This is an easy fix and is already addressed by the above PR

There also seems to be one of these messages per loop:
NFO controller.WebSphereLibertyApplication Start Semeru Compiler....
which also feels like it should be debug. This is a WLO fix, so will need to wait until the RCO fix has been merged.

We are also logging most stack traces twice. Eg. in
internal/controller/webspherelibertyapplication_controller.go
we do:

                        if err != nil {
                                reqLogger.Error(err, "Failed to reconcile Route")
                                return r.ManageError(err, common.StatusConditionTypeReconciled, instance)
                        }

The call to reqLogger.Error(err,... logs the stack trace, but the call to r.ManageError(... also logs the stack trace.
I'm not sure how easy it will be turn off stack traces from calls to log.Error(..., but it would be easy to turn off the double logging by making the messages from r.ManageError(... into debug or info messages.
@leochr what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants