Crates.io | actix-logger |
lib.rs | actix-logger |
version | 0.4.1 |
source | src |
created_at | 2023-08-17 12:35:22.40637 |
updated_at | 2023-08-19 21:37:03.24947 |
description | drop-in replacement for the actix web logger middleware |
homepage | https://codeberg.org/fawn/actix-logger |
repository | https://codeberg.org/fawn/actix-logger |
max_upload_size | |
id | 946947 |
size | 47,143 |
drop-in replacement for the default actix web logger middleware
simply changes the log level to Warn
on redirection messages and client errors, and Error
on server errors.
use actix_web::{App, HttpServer};
use actix_logger::Logger;
#[tokio::main]
async fn main() -> actix_web::Result<()> {
twink::log::setup();
HttpServer::new(|| {
App::new().wrap(Logger::default().service(/* */))
})
.bind(("127.0.0.1", 8080))?
.run()
.await
}