mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 08:22:59 +01:00
update logger doc string
This commit is contained in:
parent
7198dde465
commit
187644e178
@ -13,6 +13,9 @@ use httpresponse::HttpResponse;
|
||||
use middleware::{Middleware, Started, Finished};
|
||||
|
||||
/// `Middleware` for logging request and response info to the terminal.
|
||||
/// `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
|
||||
///
|
||||
@ -24,10 +27,14 @@ use middleware::{Middleware, Started, Finished};
|
||||
/// ```
|
||||
/// ```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();
|
||||
///
|
||||
/// let app = Application::new()
|
||||
/// .middleware(Logger::default())
|
||||
/// .middleware(Logger::new("%a %{User-Agent}i"))
|
||||
|
Loading…
Reference in New Issue
Block a user