feat: added logging standard#551
Open
PaulGregoryBaker wants to merge 1 commit into
Open
Conversation
3 tasks
|
|
||
| ### Log to Stdout | ||
|
|
||
| Write all logs to stdout. Do **not** use `console.log` or write to files directly. Delegate collection, rotation, and shipping to external tools (Fluentd, Vector, OTel Collector). In containerized environments, a sidecar or daemonset picks up stdout, enriches it with pod/host metadata, and ships it to a centralized store. |
There was a problem hiding this comment.
Is this possible in all cases? Is there an acceptable window for console logging during container startup before connectivity to the sidecar can be assured? For example: if the log is about connectivity to the side-car failing?
| | FATAL | 21-24 | ✅ Always | Service outage | DB unreachable, panic | | ||
| | ERROR | 17-20 | ✅ Always | Operation failures | Transaction failed | | ||
| | WARN | 13-16 | ✅ Always | Recoverable issues | Validation failure, retry | | ||
| | INFO | 9-12 | ✅ Always | Business events | Transfer completed | |
There was a problem hiding this comment.
"Always" for INFO here seems like it could be a risk for performance if the frequency of logging is unexpetedly high. If you're logging "business events" at a high level of granularity, you could easily log at 10x or higher compared to your actual event volume.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added logging standard for community review