File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use anyhow::Context as _;
44use axum:: body:: Body ;
55use axum:: error_handling:: HandleErrorLayer ;
66use axum:: http:: HeaderName ;
7- use axum:: response:: Html ;
7+ use axum:: response:: { Html , Response } ;
88use axum:: routing:: { get, post} ;
99use axum:: { BoxError , Router } ;
1010use hyper:: { Request , StatusCode } ;
@@ -132,6 +132,9 @@ async fn run_server(addr: SocketAddr) -> anyhow::Result<()> {
132132 } )
133133 . on_request ( |request : & Request < Body > , _span : & tracing:: Span | {
134134 tracing:: info!( ?request) ;
135+ } )
136+ . on_response ( |response : & Response < _ > , dur, _span : & tracing:: Span | {
137+ tracing:: info!( "response={} in {dur:?}" , response. status( ) ) ;
135138 } ) ,
136139 )
137140 . layer ( PropagateRequestIdLayer :: new ( X_REQUEST_ID ) )
You can’t perform that action at this time.
0 commit comments