diff --git a/guide/src/qs_10.md b/guide/src/qs_10.md index b3c5a8e06..ed36140c7 100644 --- a/guide/src/qs_10.md +++ b/guide/src/qs_10.md @@ -64,7 +64,9 @@ Active provides several useful middlewares, like *logging*, *user sessions*, etc Logging is implemented as middleware. It is common to register logging middleware as first middleware for application. -Logging middleware has to be registered for each application. +Logging middleware has to be registered for each application. *Logger* middleware +uses standard log crate to log information. You should enable logger for *actix_web* +package to see access log. ([env_logger](https://docs.rs/env_logger/*/env_logger/) or similar) ### Usage @@ -76,10 +78,14 @@ Default `Logger` could be created with `default` method, it uses the default for ``` ```rust # extern crate actix_web; +extern crate env_logger; use actix_web::Application; use actix_web::middleware::Logger; fn main() { + std::env::set_var("RUST_LOG", "actix_web=info"); + env_logger::init(); + Application::new() .middleware(Logger::default()) .middleware(Logger::new("%a %{User-Agent}i"))