nginx-gateway-fabric
nginx-gateway-fabric copied to clipboard
Add configurable data plane log level
Add Nginx error log level to NginxProxy.
Problem: Users would like to assign a log level for the data plane.
Solution: Add Nginx error log level to NginxProxy which allows users to set the error log level for Nginx.
Testing: Unit tests and manual testing.
Manual testing included
- Validating the enum values in the new
ErrorLevel
field in the NginxProxy resource. - Deploying NGF, setting up the cafe-app, deploying an NginxProxy resource, and testing each of the possible log levels and checking that the nginx conf (the
main.conf
file and runningnginx -T
) in the nginx container was updated correctly. - Checked that if the error level was not set in the NginxProxy resource, the nginx conf would be correctly updated back to the default of
info
log level. - Tested that if a log level was set to something "beneath"
notice
such as theerror
level, after making changes which would result innotice
log levels being outputted (such as deleting and re-applying cafe.yaml in the cafe example), nonotice
log levels are outputted. -
nginx -T
correctly shows themain.conf
configuration file being included in the nginx configuration. -
ps aux |grep nginx
when inside the nginx container correctly showed nginx-debug processes. - Deployed the cafe example and deleted it a few times and NGF still worked properly with no error logs in either container.
Closes #901
Checklist
Before creating a PR, run through this checklist and mark each as complete.
- [x] I have read the CONTRIBUTING doc
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] I have checked that all unit tests pass after adding my changes
- [ ] I have updated necessary documentation
- [x] I have rebased my branch onto main
- [x] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork
Release notes
If this PR introduces a change that affects users and needs to be mentioned in the release notes, please add a brief note that summarizes the change.