Skip to content
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

rpcserver: Forward HTTP server err msgs to logger. #2378

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Sep 25, 2020

The standard library HTTP server writes all errors using standard error by default when and error logger is not configured. Currently, an error logger is not being set which means the errors completely bypass the logging system.

Since the required error logger must be from the standard library logging package and a custom logger is used instead, this creates a shim to forward the log messages from a standard lib logger to the RPC server logger and configures the HTTP server to use it accordingly.

@davecgh davecgh added the bug label Sep 25, 2020
@davecgh davecgh added this to the 1.6.0 milestone Sep 25, 2020
@davecgh davecgh force-pushed the rpcserver_provide_error_logger branch from 9d92188 to e44b58c Compare September 25, 2020 08:33
@degeri
Copy link
Member

degeri commented Sep 25, 2020

xx:xx:xx.998 [ERR] RPCS: http: TLS handshake error from 127.0.0.1:32978: tls: first record does not look like a TLS handshake

LGTM. Getting logged by our logger in the right format and location.

The standard library HTTP server writes all errors using standard error
by default when and error logger is not configured.  Currently, an error
logger is not being set which means the errors completely bypass the
logging system.

Since the required error logger must be from the standard library
logging package and a custom logger is used instead, this creates a shim
to forward the log messages from a standard lib logger to the RPC server
logger and configures the HTTP server to use it accordingly.
@davecgh davecgh force-pushed the rpcserver_provide_error_logger branch from e44b58c to 1e44e86 Compare September 25, 2020 17:40
@davecgh davecgh merged commit 1e44e86 into decred:master Sep 25, 2020
@davecgh davecgh deleted the rpcserver_provide_error_logger branch September 25, 2020 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants