diff --git a/basics/src/main.rs b/basics/src/main.rs index b7406f99..7a4edcb1 100644 --- a/basics/src/main.rs +++ b/basics/src/main.rs @@ -84,7 +84,7 @@ fn main() -> io::Result<()> { App::new() // cookie session middleware .wrap(CookieSession::signed(&[0; 32]).secure(false)) - // enable logger + // enable logger - always register actix-web Logger middleware last .wrap(middleware::Logger::default()) // register favicon .service(favicon) diff --git a/cookie-auth/src/main.rs b/cookie-auth/src/main.rs index 2e428014..f8d9fc0b 100644 --- a/cookie-auth/src/main.rs +++ b/cookie-auth/src/main.rs @@ -27,6 +27,7 @@ fn main() -> std::io::Result<()> { .name("auth-example") .secure(false), )) + // enable logger - always register actix-web Logger middleware last .wrap(middleware::Logger::default()) .service(web::resource("/login").route(web::post().to(login))) .service(web::resource("/logout").to(logout)) diff --git a/redis-session/src/main.rs b/redis-session/src/main.rs index 2705866f..ba840b42 100644 --- a/redis-session/src/main.rs +++ b/redis-session/src/main.rs @@ -28,7 +28,7 @@ fn main() -> std::io::Result<()> { App::new() // redis session middleware .wrap(RedisSession::new("127.0.0.1:6379", &[0; 32])) - // enable logger + // enable logger - always register actix-web Logger middleware last .wrap(middleware::Logger::default()) // register simple route, handle all methods .service(web::resource("/").to(index))