mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-22 11:13:09 +02:00
add request logging
This commit is contained in:
parent
812b49587f
commit
e555af8895
1 changed files with 9 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
#![deny(clippy::all)]
|
#![deny(clippy::all)]
|
||||||
|
|
||||||
use crate::storage::{KVStorage, Storage};
|
use crate::storage::{KVStorage, Storage};
|
||||||
use actix_web::{get, web, App, HttpServer, Responder, Scope};
|
use actix_web::{get, middleware::Logger, web, App, HttpServer, Responder, Scope};
|
||||||
use api::{api_scope, ServerState};
|
use api::{api_scope, ServerState};
|
||||||
use clap::Arg;
|
use clap::Arg;
|
||||||
use failure::Fallible;
|
use failure::Fallible;
|
||||||
|
@ -61,7 +61,11 @@ async fn main() -> Fallible<()> {
|
||||||
let server_state = ServerState::new(server_box);
|
let server_state = ServerState::new(server_box);
|
||||||
|
|
||||||
log::warn!("Serving on port {}", port);
|
log::warn!("Serving on port {}", port);
|
||||||
HttpServer::new(move || App::new().service(app_scope(server_state.clone())))
|
HttpServer::new(move || {
|
||||||
|
App::new()
|
||||||
|
.wrap(Logger::default())
|
||||||
|
.service(app_scope(server_state.clone()))
|
||||||
|
})
|
||||||
.bind(format!("0.0.0.0:{}", port))?
|
.bind(format!("0.0.0.0:{}", port))?
|
||||||
.run()
|
.run()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue