-
Notifications
You must be signed in to change notification settings - Fork 76
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
Adds remote-address connection info to server #148
Conversation
- Reworks how a `hyper::Server` is created, to get access to the local address before starting the server itself. This allows it to be put into the key-value pairs for the server's logger, so they're printed on each subsequent message. - Updates the internal connection/request handler types to get the remote address and store it in the logger passed to the request handling functions. The remote address is also printed on each subsequent log message.
This should address #46 when merged. |
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.
Looks great! Would you mind posting some log output from before and after the change, maybe for server startup and handling a request? I think there's an existing simple example that you should be able to use.
This might be worth adding to the change log, too.
Here's how this change manifests in server logs. I ran From the current
From this PR commit:
The |
hyper::Server
is created, to get access to the localaddress before starting the server itself. This allows it to be put
into the key-value pairs for the server's logger, so they're printed
on each subsequent message.
remote address and store it in the logger passed to the request
handling functions. The remote address is also printed on each
subsequent log message.