Skip to content

Commit aab8510

Browse files
committed
change: removed handmade Logger
1 parent 68895ae commit aab8510

File tree

2 files changed

+3
-54
lines changed

2 files changed

+3
-54
lines changed

atcoder-problems-backend/src/server/middleware.rs

Lines changed: 0 additions & 52 deletions
This file was deleted.

atcoder-problems-backend/src/server/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pub(crate) mod auth;
22
pub(crate) mod internal_user;
33
pub(crate) mod language_count;
4-
pub(crate) mod middleware;
54
pub(crate) mod problem_list;
65
pub(crate) mod progress_reset;
76
pub(crate) mod ranking;
@@ -16,6 +15,8 @@ pub(crate) mod virtual_contest;
1615
use actix_web::{http::header, web, App, HttpResponse, HttpServer};
1716
pub use auth::{Authentication, GitHubAuthentication, GitHubUserResponse};
1817

18+
const LOG_TEMPLATE: &str = "{method:%{Method}i, url:%U, status:%s, duration:%T}";
19+
1920
pub async fn run_server<A>(
2021
pg_pool: sql_client::PgPool,
2122
authentication: A,
@@ -29,7 +30,7 @@ where
2930
HttpServer::new(move || {
3031
App::new()
3132
.app_data(web::Data::new(app_data.clone()))
32-
.wrap(actix_web::middleware::Logger::default())
33+
.wrap(actix_web::middleware::Logger::new(LOG_TEMPLATE))
3334
.configure(services::config_services::<A>)
3435
})
3536
.bind((host, port))?

0 commit comments

Comments
 (0)