-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add documentation for the log configuration #45940
Conversation
🤖 Vercel preview here: https://docs-l9f2tvxbw-goteleport.vercel.app/docs/ver/preview |
Other available options for defining the output include `stdout` (aliases `out` or `1`), `syslog` for writing | ||
to the syslog file, or a filepath for direct writing to a log file destination. | ||
|
||
Severity has several levels, which are sorted by increasing priority (means that if `info` is selected, `warn` and `err` also applied): |
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.
Severity has several levels, which are sorted by increasing priority (means that if `info` is selected, `warn` and `err` also applied): | |
Severity has several levels, which are sorted by decreasing priority (means that if `info` is selected, `warn` and `err` also applied): |
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.
slog misleads, they have different ordering with logrus
slog.LevelError = 8
slog.LevelWarn = 4
logrus.ErrorLevel = 2
logrus.WarnLevel = 3
🤖 Vercel preview here: https://docs-cm3ka1jr8-goteleport.vercel.app/docs/ver/preview |
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.
Thanks for putting this together!
I think it would make sense to move this to docs/pages/admin-guides/management/diagnostics
, where we explain other Teleport signals such as profiles, metrics, and traces.
Other available options for defining the output include `stdout` (aliases `out` or `1`), `syslog` for writing | ||
to the syslog file, or a filepath for direct writing to a log file destination. | ||
|
||
Severity has several levels, which are sorted by decreasing priority (means that if `info` is selected, `warn` and `err` also applied): |
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.
(means that if `info` is selected, `warn` and `err` also applied)
We should fix the grammar here and make this a complete sentence. I think it would make sense to separate this into its own sentence rather than use parentheses.
to the syslog file, or a filepath for direct writing to a log file destination. | ||
|
||
Severity has several levels, which are sorted by decreasing priority (means that if `info` is selected, `warn` and `err` also applied): | ||
- `err`, `error` - used for errors that should definitely be noted. |
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.
What does "should definitely be noted" mean?
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.
Means that these log messages indicate actions are required to fix them, errors may lead to an unpredictable state of the application
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 would say, "Logs that require action from the user" instead of "Should definitely be noted".
- `debug` - usually only enabled when debugging, verbose logging. | ||
- `trace` - designates more detailed informational events than the debug. |
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.
The descriptions here are self evident, I think. Is there anything we can say about the kinds of logs a user can expect when enabling debug
or trace
-level logging?
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.
trace
usually shows very detail information like sequence of method executions
Did simple search by code base, so we don't use this level that much:
s.log.WithField("event", event).Trace("sessionCache: Received watcher event")
s.log.WithField("session_id", s.ID()).Trace("session will be recorded at proxy")
log.WithFields(log.Fields{
"src_addr": fmt.Sprintf("%v", source),
"dst_addr": fmt.Sprintf("%v", destination),
"cluster_name": p.clusterName}).Trace("Successfully generated signed PROXY header")
// Okta plugin.
log.Trace("Collating plugin resource")
log.Trace("Installing plugin")
- `debug` - usually only enabled when debugging, verbose logging. | ||
- `trace` - designates more detailed informational events than the debug. | ||
|
||
The default format for log output is `text`. Another available format is `json`, which may simplify log |
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.
What does "may simplify" mean here?
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.
means that json already has a structure for parsing with field names, if we use text, usually regular expression is used to extract data from text message
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.
🤖 Vercel preview here: https://docs-2zyouwui1-goteleport.vercel.app/docs/ver/preview |
- `warn`, `warning` - non-critical entries that deserve attention. | ||
- `info` or empty value - general operational entries about what's going on inside the application. | ||
- `debug` - usually only enabled when debugging, verbose logging. | ||
- `trace` - designates more detailed information about actions and events. |
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.
Do we ever use "trace" level in our code? I don't think we do?
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.
we use, but very limited #45940 (comment), so might be better to remove?
@ptgott, could you please take another look at the PR? |
🤖 Vercel preview here: https://docs-kxytd1emr-goteleport.vercel.app/docs/ver/preview |
38decd6
to
aa5ac4b
Compare
🤖 Vercel preview here: https://docs-m1lb76i8a-goteleport.vercel.app/docs/ver/preview |
In this PR added documentation for the logger configuration in Teleport, since filesystem watcher added for the log file we should noted about new behaviour in case of move/rename/delete the log file. Also sample configuration for logrotate is added.
Related: #43359