Skip to content

ym-project/actix-logger-light

Repository files navigation

Actix logger light

Fork of build-in actix-web logger middleware. Purposes:

  • remove default error logging. Actix's logger marks errors as DEBUG and there is no way to customize this behavior. See issue
  • remove formatting in favor of single hardcoded format %a "%r" %s %b "%{Referer}i" "%{User-Agent}i" %T output example: 127.0.0.1 "GET /test HTTP/1.1" 404 20 "-" "HTTPie/2.2.0" 0.001074

Use it if you want to speed up your server a little and don't need to customize log output.

Installation

cargo add actix-logger-light

Example

use actix_web::{App};
use actix_logger_light::Logger;

// Init logger using env_logger or similar crate
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

let app = App::new().wrap(Logger::default());

License

This project is licensed under of MIT license (LICENSE or https://opensource.org/licenses/MIT)

About

Light logger middleware for actix-web

Topics

Resources

Stars

Watchers

Forks

Releases

Used by

Contributors

Languages