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

Support k8s objects variables in log format #1231

Merged
merged 16 commits into from
Dec 1, 2020
Merged

Conversation

LorcanMcVeigh
Copy link
Contributor

Proposed changes

This PR updates the Ingress Controller log format for both Ingress and VirtualServer resources with k8s object details.

  • resource name
  • resource type
  • resource namespace
  • service

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

Hi @LorcanMcVeigh

Please see my feedback

I think it's better to rename the PR to something like "Support k8s objects variables in log format", rather than "Update IC log format " to better reflect the PR contents.

@@ -205,7 +205,7 @@ See the doc about [VirtualServer and VirtualServerRoute resources](/nginx-ingres
* - ``log-format``
- Sets the custom `log format <https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format>`_ for HTTP and HTTPS traffic. For convenience, it is possible to define the log format across multiple lines (each line separated by ``\n``). In that case, the Ingress Controller will replace every ``\n`` character with a space character. All ``'`` characters must be escaped.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a misunderstanding that those variables should always be present in the log format. It is not the case - those variables should be available, but the admin may choose to not use them.

For the docs, it is necessary to describe what variables are available for admins to use and what they mean.

The example of the log line is useful. However, we should also have the example of a value you can put in the ConfigMap (the log format). So that the reader can copy that value and use it in their ConfigMap.

internal/configs/ingress.go Outdated Show resolved Hide resolved
internal/configs/version1/config.go Outdated Show resolved Hide resolved
internal/configs/version1/nginx-plus.ingress.tmpl Outdated Show resolved Hide resolved
internal/configs/version1/nginx-plus.ingress.tmpl Outdated Show resolved Hide resolved
internal/configs/version1/nginx.tmpl Outdated Show resolved Hide resolved
internal/configs/version2/nginx-plus.virtualserver.tmpl Outdated Show resolved Hide resolved
internal/configs/version2/nginx-plus.virtualserver.tmpl Outdated Show resolved Hide resolved
internal/configs/version2/nginx-plus.virtualserver.tmpl Outdated Show resolved Hide resolved
Co-authored-by: Dean Coakley <dean.s.coakley@gmail.com>
internal/configs/virtualserver.go Outdated Show resolved Hide resolved
LorcanMcVeigh and others added 3 commits November 26, 2020 10:00
Co-authored-by: Dean Coakley <dean.s.coakley@gmail.com>
@LorcanMcVeigh LorcanMcVeigh merged commit 4285b29 into master Dec 1, 2020
@LorcanMcVeigh LorcanMcVeigh deleted the update-log-format branch December 1, 2020 10:29
@pleshakov pleshakov changed the title Update IC log format Support k8s objects variables in log format Jan 21, 2021
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.

5 participants