1
0
mirror of https://github.com/actix/actix-website synced 2024-11-25 01:02:58 +01:00
actix-website/examples/middleware/src/logger.rs

15 lines
286 B
Rust
Raw Normal View History

2019-06-17 22:57:57 +02:00
// <logger>
use actix_web::middleware::Logger;
use actix_web::App;
use env_logger;
fn main() {
std::env::set_var("RUST_LOG", "actix_web=info");
env_logger::init();
App::new()
.wrap(Logger::default())
.wrap(Logger::new("%a %{User-Agent}i"));
}
// </logger>