You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the CatchPanicLayer to log panics and return status 500. I also use SetRequestIdLayer/PropagateRequestIdLayer to add a request id to all responses. This works fine and 500 errors returned by the CatchPanicLayer does include a request id.
My issue is that the logs emitted by CatchPanicLayer does not include the request id, making it difficult to track down which request was responsible for the panic. I thought I could work around this with a custom panic handler (CatchPanicLayer::custom) but found that I'm not able to access the request in this handler, making it impossible to access the request id.
Is it possible to access the request or at least the request id in CatchPanicLayer::custom somehow?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
I use the
CatchPanicLayer
to log panics and return status 500. I also useSetRequestIdLayer
/PropagateRequestIdLayer
to add a request id to all responses. This works fine and 500 errors returned by theCatchPanicLayer
does include a request id.My issue is that the logs emitted by
CatchPanicLayer
does not include the request id, making it difficult to track down which request was responsible for the panic. I thought I could work around this with a custom panic handler (CatchPanicLayer::custom
) but found that I'm not able to access the request in this handler, making it impossible to access the request id.Is it possible to access the request or at least the request id in
CatchPanicLayer::custom
somehow?tower-http version
0.6.2
Beta Was this translation helpful? Give feedback.
All reactions