kubernetes-ingress icon indicating copy to clipboard operation
kubernetes-ingress copied to clipboard

Make access_log for main configurable

Open hafe opened this issue 1 year ago • 9 comments

Is your feature request related to a problem? Please describe. Currently it is not possible to globally configure log forward of access logs in a simple way. Logging high volume access logs to stdout means that they get forwarded to the log stack in Kubernetes. This can be problematic depending on the stack.

Describe the solution you'd like Add a directive to the global Config map where the main access_log directive can be overridden

Describe alternatives you've considered An alternative solution is to use a custom main template which is far from simple.

Additional context Add any other context or screenshots about the feature request here.

hafe avatar May 27 '24 14:05 hafe

Hi @hafe thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this :slightly_smiling_face:

Cheers!

github-actions[bot] avatar May 27 '24 14:05 github-actions[bot]

Just to mention, I have started working on a pull request.

hafe avatar May 27 '24 14:05 hafe

Thank you @hafe we will review this issue in our community call.

danielnginx avatar May 27 '24 16:05 danielnginx

related https://github.com/nginxinc/kubernetes-ingress/discussions/4341

vepatel avatar May 30 '24 13:05 vepatel

Hi @hafe ,

We had a chance to discuss this issue and I want to add some context.

The future state is to integrate with OpenTelemetry and streaming logs using it. We are planning on it but we do not have a timeline for this work.

Until we get to a more robust solution we are happy to accept your contribution with some conditions:

1 - We need a flag to enable the access log 2 - The default access log is always off 3 - We must block any configuration that allows logging to files

Please let us know what you think about it?

danielnginx avatar Jun 10 '24 10:06 danielnginx

Let's see:

  1. already exist
  2. is the inverse of today's default, I don't understand?
  3. I can see if I can add some validation to not allow file

hafe avatar Jun 10 '24 15:06 hafe

Apologies, I should mention that I was looking in the PR.

Keep the flag as it is AccessLogOff.

Allow the access_log configuration but preventing logging to files.

danielnginx avatar Jun 11 '24 11:06 danielnginx

Check latest version, only allows syslog

hafe avatar Jun 12 '24 05:06 hafe

Tagging @jjngx

danielnginx avatar Jun 13 '24 14:06 danielnginx