poem icon indicating copy to clipboard operation
poem copied to clipboard

Log not showing request that causes a bad request

Open finlaydotb opened this issue 1 year ago • 1 comments

I am getting a 400 bad request to an endpoint but the log only shows

2023-05-16T05:45:45.190235Z DEBUG hyper::proto::h1::io: parsed 12 headers
2023-05-16T05:45:45.190280Z DEBUG hyper::proto::h1::conn: incoming body is content-length (1592 bytes)
2023-05-16T05:45:45.190346Z DEBUG hyper::proto::h1::conn: incoming body completed
2023-05-16T05:45:45.191518Z DEBUG hyper::proto::h1::io: flushed 220 bytes

Tracing is initiated as follows

    if env::var_os("RUST_LOG").is_none() {
        env::set_var("RUST_LOG", "poem=debug");
    }
    tracing_subscriber::fmt::init();

It will be nice to be able to see the data that comes in and the exact error. Will be useful in debugging

finlaydotb avatar May 16 '23 05:05 finlaydotb

Just for debugging maybe this catch_all handler can be useful for you.

VersBinarii avatar May 16 '23 07:05 VersBinarii