How to write access logs to /var/logs/nginx/access.log instead of stdout? #4341
Replies: 5 comments 1 reply
-
Hi @noor-muradi It's currently only possible to toggle on/off access logging using a ConfigMap. You will have to use custom-templates in order to overwrite the log output directory that we set for access_log For NGINX OSS the output directory for access_logs are set here: For NGINX Plus, it's set here: If anything is unclear on how this works, please let me know! |
Beta Was this translation helpful? Give feedback.
-
Just adding another data point to this. I have a customer who would like the ability to configure a different destination for access_log. They are existing NGINX App Protect customers, and have configured NAP to send the logs to an external syslog server. They would like for NGINX Ingress Controller to have similar capability to standardize how logs are streamed. They are currently modifying the Virtual Server template to set a custom access_log destination as a workaround, but that is not ideal as they have to update the template each time NGINX Ingress Controller gets updated. |
Beta Was this translation helpful? Give feedback.
-
hi @noor-muradi, we're looking at this proposal and figuring out what's the best way to design such solution. Will keep you updated here 👍🏼 |
Beta Was this translation helpful? Give feedback.
-
Hi @noor-muradi, because of how quickly the volumes can get filled with access-logs, we're a bit apprehensive of making this a default capability in NIC. Still investigating |
Beta Was this translation helpful? Give feedback.
-
How to make the Nginx ingress controller to write logs to log file instead of stdout?
I have deployed Nginx Ingress controller using the helm chart, I want to persist the logs using Persistent Volume so that I can use filebeat to push logs to Elastic Search for monitoring, the Nginx ingress by default output the logs to stdout, I have tried to make an entry to values.yaml but the logs are not written to /var/logs/access.log which is mounted to PVC and the hostPath which is configured in PVC has the permission RWX for UID "101"
Beta Was this translation helpful? Give feedback.
All reactions