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 _;
4
4
use axum:: body:: Body ;
5
5
use axum:: error_handling:: HandleErrorLayer ;
6
6
use axum:: http:: HeaderName ;
7
- use axum:: response:: Html ;
7
+ use axum:: response:: { Html , Response } ;
8
8
use axum:: routing:: { get, post} ;
9
9
use axum:: { BoxError , Router } ;
10
10
use hyper:: { Request , StatusCode } ;
@@ -132,6 +132,9 @@ async fn run_server(addr: SocketAddr) -> anyhow::Result<()> {
132
132
} )
133
133
. on_request ( |request : & Request < Body > , _span : & tracing:: Span | {
134
134
tracing:: info!( ?request) ;
135
+ } )
136
+ . on_response ( |response : & Response < _ > , dur, _span : & tracing:: Span | {
137
+ tracing:: info!( "response={} in {dur:?}" , response. status( ) ) ;
135
138
} ) ,
136
139
)
137
140
. layer ( PropagateRequestIdLayer :: new ( X_REQUEST_ID ) )
You can’t perform that action at this time.
0 commit comments