Commit d4fd43b
authored
logger: force_stacktrace_level was not applied to PluginLogger (#5038)
**Which issue(s) this PR fixes**:
* Fixes a bug in #5008
**What this PR does / why we need it**:
In #5008, we have added a new feature `force_stacktrace_level`.
However, it was not applied to `PluginLogger`.
So, depending on the settings and error locations,
`force_stacktrace_level` could not work.
This PR fixes it.
**Docs Changes**:
Not needed because #5008 is not released yet.
**Release Note**:
Not needed because #5008 is not released yet.
**How to reproduce the bug**:
conf:
```xml
<system>
<log>
forced_stacktrace_level info
</log>
</system>
<source>
@type sample
@id test
tag test.fail
</source>
<match test.fail>
@type null
@id null
never_flush
<buffer>
flush_mode interval
flush_interval 1s
</buffer>
</match>
```
* Set `@id` to use `PluginLogger`.
* Use `buffer` to use `PluginLogger`.
* Without `buffer`, `RootAgent` outputs the logs for flushing errors by
using the global logger. (`RootAgent#handle_emits_error`)
log:
```
2025-07-29 12:39:36 +0900 [info]: #0 fluentd worker is now running worker=0
2025-07-29 12:39:38 +0900 [warn]: #0 [null] failed to flush the buffer. retry_times=0 next_retry_time=2025-07-29 12:39:39 +0900 chunk="63b09284c334efa1927547b5623268ff" error_class=RuntimeError error="failed to flush"
2025-07-29 12:39:38 +0900 [warn]: #0 /home/daipom/work/fluentd/fluentd/lib/fluent/plugin/out_null.rb:59:in `write'
2025-07-29 12:39:38 +0900 [warn]: #0 /home/daipom/work/fluentd/fluentd/lib/fluent/plugin/output.rb:1212:in `try_flush'
2025-07-29 12:39:38 +0900 [warn]: #0 /home/daipom/work/fluentd/fluentd/lib/fluent/plugin/output.rb:1527:in `flush_thread_run'
2025-07-29 12:39:38 +0900 [warn]: #0 /home/daipom/work/fluentd/fluentd/lib/fluent/plugin/output.rb:490:in `block (2 levels) in start'
2025-07-29 12:39:38 +0900 [warn]: #0 /home/daipom/work/fluentd/fluentd/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
```
* The log levels of stacktraces are `warn`, although
`forced_stacktrace_level` is `info`.
Signed-off-by: Daijiro Fukuda <[email protected]>1 parent 56ba858 commit d4fd43b
2 files changed
+86
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
652 | 653 | | |
653 | 654 | | |
654 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
655 | 659 | | |
656 | 660 | | |
657 | 661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | 814 | | |
823 | 815 | | |
824 | 816 | | |
| |||
864 | 856 | | |
865 | 857 | | |
866 | 858 | | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
867 | 898 | | |
868 | 899 | | |
869 | 900 | | |
| |||
1114 | 1145 | | |
1115 | 1146 | | |
1116 | 1147 | | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1117 | 1191 | | |
1118 | 1192 | | |
1119 | 1193 | | |
| |||
0 commit comments