-
Notifications
You must be signed in to change notification settings - Fork 114
Configurable Data Plane Log Format #1200
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
Comments
Hey, is there a workaround to configure logging right now? e.g. I want to log a specific header for each request, is there a way to achieve this? |
Hey @kiyutink, the current workaround to configuring logging would be using SnippetsFilters, which allow you to insert nginx configuration into the configuration that NGF generates. Here's a guide on using them https://docs.nginx.com/nginx-gateway-fabric/how-to/traffic-management/snippets/. You would then be able to add and configure the nginx directives Hopefully you can play around with the nginx configuration to get it to work! |
Hey @bjee19 , thank you for the detailed reply. Just one thing - is it possible to reference the SnippetsFilter not from a route resource? Ideally, I would like to be able to set one default log format for all routes, without explicitly referencing that format in each The best thing I could think of is using a "fake" route that never matches but adds a filter, but perhaps there's something less "hacky"? |
@kiyutink Unfortunately it is not currently possible to reference the SnippetsFilter a resource that is not a route. Ideally in situations like this, we'd have completed the above story hahaha, but since we haven't, SnippetsFilters are the only means to solve this situation and are meant to kind of be a last resort hack job. SnippetsFilters and snippets are designed to be small insertions of configuration into specific areas, so it unfortunately makes sense for it to feel hacky when trying to insert configuration which affects large areas. Best choice is to either see if that "fake" route works, or just switching the SnippetsFilters between stable routes, which shouldn't be too much of an issue unless you're moving around routes frequently. Sorry that its not the best options, but hopefully once this story gets completed there will be a better option! |
As a user of NGF
I want to have the ability to configure the log format of NGINX's access and error logs
So that I can easily collect logs from NGINX in my logging platform.
Acceptance
The text was updated successfully, but these errors were encountered: