-
Notifications
You must be signed in to change notification settings - Fork 196
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
Controller logging improvements #1759
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT license. | ||
*/ | ||
|
||
package logging | ||
|
||
// These levels are defined to categorize (roughly) what a given log level means. They serve as guidelines | ||
// to help decide what level a new log should be emitted at. They are not rules that must be followed. | ||
// Keep in mind that there may be logs logged at a level higher | ||
// than Debug (the highest log level defined below). Logs between levels 4 and 10 are progressively | ||
// more verbose and are used rarely. | ||
|
||
const ( | ||
// Status logs are logs that should ALWAYS be shown. In the context of a controller, | ||
// Status logs should not be happening for every reconcile loop. Examples of good Status logs | ||
// are state changes or major problems. These probably line up very nicely with interesting | ||
// customer facing "events" as well. | ||
Status = 0 | ||
|
||
// Info logs are logs that are probably useful but may be slightly more verbose. | ||
// In the context of a controller, an Info log probably shouldn't be emitted every time through | ||
// the reconcile loop, at least in the happy path. | ||
// Examples of good Info logs include intermittent errors which we expect to be able to retry through | ||
// and object updates (think: "set ownerReference" or similar things which are not critical state changes | ||
// but are still interesting updates that aren't super verbose). | ||
Info = 1 | ||
|
||
// Verbose logs are logs that are quite verbose. In the context of a controller | ||
// they likely log on each reconcile loop. Examples of good Verbose logs include | ||
// "waiting for deployment..." or "waiting for deletion to complete..." | ||
Verbose = 2 | ||
|
||
// Debug logs are logs that are extremely verbose and log each reconcile loop (or multiple times in a single | ||
// reconcile loop). Examples include ARM request and response payloads, or request and response payloads | ||
// from APIServer. | ||
Debug = 3 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If something stalls and never makes progress, this log line might be the key to spotting the situation.
Suggest restoring this, but at Verbose level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this because we actually already logged this above on line 355 pretty much, so this line was duplicate. Actually the above line is better because it also includes the current
Ready
condition andhasChanged
.