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

caddyhttp: Split up logged remote address into IP and port #4403

Merged
merged 1 commit into from Nov 29, 2021

Conversation

francislavoie
Copy link
Member

Closes #4396, related to #4148

This is a breaking change, but we're already planning on removing thecommon_log field as well at the same time, so might as well all do it together.

In general, the remote IP is the useful part of the remote address. The port is rarely useful, because it only identifies ephemeral information about the connection from the client. But we were logging both in one field, so certain tooling that would want to only get the remote IP would need to split it up. Splitting is non-trivial, because of IPv4, IPv6, shenanigans. So it's best if we split it up-front before logging. If the log consumer actually cares about the remote port, it can re-assemble it.

@francislavoie francislavoie added the under review 🧐 Review is pending before merging label Nov 1, 2021
@francislavoie francislavoie added this to the v2.5.0 milestone Nov 1, 2021
mholt
mholt previously approved these changes Nov 1, 2021
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I begrudingly approve. 🙂

@mholt mholt removed the under review 🧐 Review is pending before merging label Nov 1, 2021
@francislavoie francislavoie added the do not merge ⛔ Not ready yet! label Nov 1, 2021
@francislavoie
Copy link
Member Author

Tagging it with "do not merge", so we can put it in just before/when we're ready for 2.5.0

mohammed90
mohammed90 previously approved these changes Nov 2, 2021
Copy link
Member

@mohammed90 mohammed90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whee! I'll make a note in the format-encoder to update it once this is released 😃

mohammed90
mohammed90 previously approved these changes Nov 26, 2021
Closes #4396, related to #4148

This is a breaking change, but we're already planning on removing  the`common_log` field as well at the same time, so might as well all do it together.

In general, the remote IP is the useful part of the remote address. The port is rarely useful, because it only identifies ephemeral information about the connection from the client. But we were logging both in one field, so certain tooling that would want to only get the remote IP would need to split it up. Splitting is non-trivial, because of IPv4, IPv6, shenanigans. So it's best if we split it up-front before logging. If the log consumer actually cares about the remote port, it can re-assemble it.
@francislavoie francislavoie merged commit f55b123 into master Nov 29, 2021
@francislavoie francislavoie deleted the logging-split-remote-addr branch November 29, 2021 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate log field for request port
3 participants