I have actix-web and struggle debugging, as the logger writes at the end only, and if something fails, it doesnt write at all.
RUST_LOG=actix_web=debug,actix_server=debug
let server = HttpServer::new(move || {
App::new()
.wrap(Logger::default())
.wrap(Logger::new(
"Request Pre",
)
)
.wrap(add_service())
.configure(add_routes)
[2021-02-05T14:29:02Z INFO my_lib::middleware::foo] Foo Middleware Finished
[2021-02-05T14:29:02Z INFO my_lib::middleware::bar] Bar Middleware Finished
[2021-02-05T14:29:01Z INFO actix_web::middleware::logger] Request Pre
[2021-02-05T14:29:01Z INFO actix_web::middleware::logger] 127.0.0.1:54321 "POST /call/me HTTP/1.1"
How can I control the Pre-Processing (and add logs in there), so to ensure that first thing a log is written when a request arrives?
question from:https://stackoverflow.com/questions/66065426/ensure-actix-logging-in-chronological-order-pre-process