tracing_appender did not work as global? #2210
-
Beta Was this translation helpful? Give feedback.
Answered by
davidbarsky
Jul 8, 2022
Replies: 1 comment 1 reply
-
You're currently dropping |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
davidbarsky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're currently dropping
tracing_appender
's_guard
at the end oflog_init
. Instead, it must be returned from thelog_init
function tofn main
(or whatever function lives as long as the program does), as dropping the guard will close the file writer. For additional details, see the documentation onWorkerGuard
. Once you do that, you should see things logged to the file.