Open reddyblokesh opened 1 month ago
Hi @reddyblokesh 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!
Hi @reddyblokesh, are you using Ingress or custom resources? I haven't been able to reproduce on 3.4.3, I can see that /var/log/nginx/access.log
gets created but it remains empty and logs are correctly sent to stdout. Could you also try running grep access.log /etc/nginx/conf.d/*
in case the log configuration is coming from another file? Thanks!
grep access.log /etc/nginx/conf.d/*
access_log /var/log/nginx/access.log main; access_log on;
grep stdout /etc/nginx/nginx.conf
access_log /dev/stdout main; access_log /dev/stdout stream-main;
ls -la /var/log/nginx/ : total 36 drwxrwxr-x. 1 nginx root 24 Feb 19 13:41 . drwxr-xr-x. 1 root root 19 Feb 19 13:41 .. -rw-rw----. 1 nginx root 34935 May 17 10:38 access.log -rw-rw----. 1 nginx root 0 Feb 19 13:41 error.log
to reproduce this we tried to upgrade nginx ingress controller to nginx plus in another namespace running a different app in backend and we faced the same issue even there. so it looks like a bug ? can you please confirm or should we build a custom image but adding a symlink similar to what we have in docker-mn ?
@reddyblokesh just to understand your use-case are you using Ingress or VirtualServer (custom resources), and are you using the snippets feature? If you are not using snippets to add access_log /var/log/nginx/access.log main; access_log on;
then it could be a bug with our Plus templates.
We currently do not manually add symlinks, but they are added upstream in the OSS container that we build from, so we can investigate adding the links to our Plus images.
config: entries: ingress-template: | access_log /var/log/nginx/access.log main;
@reddyblokesh to clarify:
For now, I recommend you either build a custom image with the symlink, or change your example above to use /dev/stdout
instead of /var/log/nginx/access.log
. We will investigate adding the symlinks for a future release to better align the OSS and Plus images.
Is there a reason that you use /var/log/nginx/access.log
instead of /dev/stdout
? Knowing the use-case will help prioritise the work to add the symlinks.
@jasonwilliams14 fyi
Describe the bug Nginx-plus ingress controller doesnt create symbolic link for access.log -> /dev/stdout To Reproduce Steps to reproduce the behavior:
Expected behavior should be able to redirect to stdout and in k logs -f
Your environment
Additional context nginx config has access.log configured: grep access.log /etc/nginx/nginx.conf