@@ -50,42 +50,42 @@ impl LogMiddleware {
5050 if status. is_server_error ( ) {
5151 if let Some ( error) = response. error ( ) {
5252 log:: error!( "Internal error --> Response sent" , {
53- message: error. to_string( ) ,
53+ message: format! ( " \" {} \" " , error. to_string( ) ) ,
5454 method: method,
5555 path: path,
56- status: status as u16 ,
56+ status: format! ( "{} - {}" , status as u16 , status . canonical_reason ( ) ) ,
5757 duration: format!( "{:?}" , start. elapsed( ) ) ,
5858 } ) ;
5959 } else {
6060 log:: error!( "Internal error --> Response sent" , {
6161 method: method,
6262 path: path,
63- status: status as u16 ,
63+ status: format! ( "{} - {}" , status as u16 , status . canonical_reason ( ) ) ,
6464 duration: format!( "{:?}" , start. elapsed( ) ) ,
6565 } ) ;
6666 }
6767 } else if status. is_client_error ( ) {
6868 if let Some ( error) = response. error ( ) {
6969 log:: warn!( "Client error --> Response sent" , {
70- message: error. to_string( ) ,
70+ message: format! ( " \" {} \" " , error. to_string( ) ) ,
7171 method: method,
7272 path: path,
73- status: status as u16 ,
73+ status: format! ( "{} - {}" , status as u16 , status . canonical_reason ( ) ) ,
7474 duration: format!( "{:?}" , start. elapsed( ) ) ,
7575 } ) ;
7676 } else {
7777 log:: warn!( "Client error --> Response sent" , {
7878 method: method,
7979 path: path,
80- status: status as u16 ,
80+ status: format! ( "{} - {}" , status as u16 , status . canonical_reason ( ) ) ,
8181 duration: format!( "{:?}" , start. elapsed( ) ) ,
8282 } ) ;
8383 }
8484 } else {
8585 log:: info!( "--> Response sent" , {
8686 method: method,
8787 path: path,
88- status: status as u16 ,
88+ status: format! ( "{} - {}" , status as u16 , status . canonical_reason ( ) ) ,
8989 duration: format!( "{:?}" , start. elapsed( ) ) ,
9090 } ) ;
9191 }
0 commit comments