Skip to content

How to write access logs to /var/logs/nginx/access.log instead of stdout? #4341

Closed Answered by brianehlert
noor-muradi asked this question in Q&A
Discussion options

You must be logged in to vote

NGINX Ingress Controller outputs to stdout following K8s convention. So that the NIC logs are captured and associated with the pods. This is normal K8s practice.

NGINX (the proxy used under the hood) can send event or access logs direct to syslog sink. This would be an override of the NIC templates and at this point require modifying the templates and building the image, or the use of a custom image.

That said, there are customers that direct NGINX logs to file (Access log most commonly). And the warning we give there is around volume filling which results in the pod being killed. Because log rotation cron jobs do not run within containers.

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brianehlert
Comment options

Answer selected by jjngx
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants