-
Notifications
You must be signed in to change notification settings - Fork 1.4k
log: add system_config option to force stacktrace level #5008
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
Merged
daipom
merged 1 commit into
fluent:master
from
daipom:log-add-systemconfig-option-to-force-stacktrace-level
Jun 25, 2025
Merged
log: add system_config option to force stacktrace level #5008
daipom
merged 1 commit into
fluent:master
from
daipom:log-add-systemconfig-option-to-force-stacktrace-level
Jun 25, 2025
Conversation
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
kenhys
reviewed
Jun 24, 2025
The failure of CI is unrelated to this PR. |
Signed-off-by: Daijiro Fukuda <[email protected]>
2954a4d
to
058b8f9
Compare
daipom
added a commit
to daipom/fluentd-docs-gitbook
that referenced
this pull request
Jun 24, 2025
fluent/fluentd#5008 Signed-off-by: Daijiro Fukuda <[email protected]>
Ready. |
daipom
added a commit
to daipom/fluentd-docs-gitbook
that referenced
this pull request
Jun 24, 2025
fluent/fluentd#5008 Signed-off-by: Daijiro Fukuda <[email protected]>
Note: This feature is for users who need to monitor Fluentd's log files directly. |
daipom
added a commit
to daipom/fluentd-docs-gitbook
that referenced
this pull request
Jun 25, 2025
fluent/fluentd#5008 Signed-off-by: Daijiro Fukuda <[email protected]>
kenhys
approved these changes
Jun 25, 2025
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.
LGTM.
Thanks! |
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.
Which issue(s) this PR fixes:
None.
What this PR does / why we need it:
What this PR does
Add a new system_config option:
forced_stacktrace_level
.system/log/forced_stacktrace_level
enum
none
,trace
,debug
,info
,warn
,error
,fatal
none
By default, the behavior of Fluentd does not change.
So, this does not affect existing users.
If you set this option and change the value, the log levels of stacktraces are forced to that value.
Stacktraces that do not meet the log level are discarded in advance.
After the log level is changed, it is judged again for logging or discarded finally.
For example, by default (
log_level info
), ...trace
/debug
stacktraces are not logged regardless of this option.forced_stacktrace_level debug
, then all stacktraces are not logged.This is because we should avoid logging logs that contradict
log_level
, and to avoid unexpectedly logging logs that are initiallytrace
/debug
level.Setting example:
why we need it
To make it easier to exclude stacktraces from monitoring Fluentd's own logs.
(You don't need this feature if using @FLUENT_LOG to transfer. For some reason, there are users who need to monitor Fluentd's log files directly. This feature is for those uses.)
For example, there could be a system that raises an alert when an error-level log is detected.
You may want to exclude some error-level logs from the detection.
However, if stacktraces are logged at error level, you need to exclude those stacktraces as well.
With the current specification, that is troublesome.
Ideally, it would be preferable to exclude all stacktraces from the detection.
It is sufficient to have access to stacktraces when investigating the details.
An easy way to improve the current situation is this feature.
If you are detecting error logs as in the previous example, you can easily exclude all stacktraces from the detection by forcing the stacktrace level to
info
with this feature.Docs Changes:
Release Note:
System configuration: Add
forced_stacktrace_level
to force the log level of stacktraces.Sample:
Without
forced_stacktrace_level info
:With
forced_stacktrace_level info
: