-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.2] Log all http request/response at debug log level #1000
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice logging!
} catch (chain::tx_duplicate& e) { | ||
error_results results{409, "Conflict", error_results::error_info(e, verbose_http_errors)}; | ||
cb( 409, fc::time_point::maximum(), fc::variant( results )); | ||
fc_dlog( logger(), "Duplicate trx while processing ${api}.${call}: ${e}", | ||
("api", api_name)("call", call_name)("e", e.to_detail_string()) ); | ||
} catch (fc::eof_exception& e) { | ||
error_results results{422, "Unprocessable Entity", error_results::error_info(e, verbose_http_errors)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to your PR. I am not sure why fc::eof_exception
was mapped to 422. The error message said it was "Unable to parse arguments" and used body
as arguments. It did not log ("e", e.to_detail_string()
like other exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure.
stream << req; | ||
} | ||
buffer.resize( std::strlen( buffer.data() ) ); | ||
if( buffer.size() == max_size ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should ==
be >=
and truncate buffer between max_size .. buffer.size()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buffer.size()
can't be greater than max_size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, didn't notice buffer was initialized to max_size.
Log all http request and response at
debug
log level. Limit output to 1024 characters to avoid excessive logging.Examples: