Skip to content

Commit 0eb4bbe

Browse files
joaoantoniocardosopatrickelectric
authored andcommitted
src: server: Log actix_web with tracing.
1 parent 830bcfd commit 0eb4bbe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/server/manager.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use paperclip::{
1111
};
1212

1313
use tracing::*;
14+
use tracing_actix_web::TracingLogger;
1415

1516
fn json_error_handler(error: JsonPayloadError, _: &HttpRequest) -> actix_web::Error {
1617
warn!("Problem with json: {error}");
@@ -52,6 +53,7 @@ pub async fn run(server_address: &str) -> Result<(), std::io::Error> {
5253
let fut = srv.call(req);
5354
async { Ok(fut.await?) }
5455
})
56+
.wrap(TracingLogger::default())
5557
.wrap(actix_web::middleware::Logger::default())
5658
.wrap_api_with_spec(Api {
5759
info: Info {

0 commit comments

Comments
 (0)