logging: Prep for common_log
removal
#4149
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #4148 (comment)
With the upcoming removal of
common_log
from access logs, there's a few things we should do to smooth things out to offer a path for backwards compatibility.Add a
common_log
time format, which matches the format from the{time.now.common_log}
placeholder which is currently used for thecommon_log
field. This will make it easier for users of https://github.com/caddyserver/format-encoder to get the same time format by doing something like this:Add the
http.auth.user.id
placeholder's value to the logs. This currently isn't in the access logs, so if we dropcommon_log
, that wouldn't be visible anywhere in the access logs, and therefore not be possible to recover using https://github.com/caddyserver/format-encoder. I went withuser_id
for the field name but it could just as easily beauth_user_id
. 🤷♂️