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

logging: Prep for common_log removal #4149

Merged
merged 1 commit into from Jul 14, 2021
Merged

logging: Prep for common_log removal #4149

merged 1 commit into from Jul 14, 2021

Conversation

francislavoie
Copy link
Member

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 the common_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:

    log {
      format formatted <insert common log template here> {
        time_format common_log
      }
    }
    
  • Add the http.auth.user.id placeholder's value to the logs. This currently isn't in the access logs, so if we drop common_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 with user_id for the field name but it could just as easily be auth_user_id. 🤷‍♂️

@francislavoie francislavoie added this to the 2.x milestone May 6, 2021
@francislavoie francislavoie requested a review from mholt May 6, 2021 04:56
@mholt mholt added the under review 🧐 Review is pending before merging label May 7, 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.

Good first steps. Thanks @francislavoie !

@mholt mholt removed the under review 🧐 Review is pending before merging label Jul 14, 2021
@mholt mholt merged commit 124ba1b into master Jul 14, 2021
@mholt mholt deleted the common-log-prep branch July 14, 2021 17:07
@mholt
Copy link
Member

mholt commented Jul 14, 2021

Next steps would probably be to remove the common_log field from the access logs.

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.

None yet

2 participants