Commit 17feb09
authored
Log panics through tracing so they reach the rolling log file (#241)
Rust's default panic hook writes only to stderr, so panics never reached
the rolling file appender (logs/beacon.log.*), making post-mortem
debugging from log files impossible.
Install a panic hook in async_main() (right after setup_tracing) that
routes panics through `tracing` at ERROR level via the tracing-panic
crate, while chaining the default hook to preserve stderr output. Panics
now appear in both stdout and the rolling log file with message,
location, and (when RUST_BACKTRACE is set) a backtrace.
Closes #2391 parent 6c100fd commit 17feb09
3 files changed
Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
84 | 95 | | |
85 | 96 | | |
86 | 97 | | |
| |||
0 commit comments