-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Nginx access logs are not showing up in stdout #3163
Comments
@kirs how are you testing this? |
I was testing this by finding the IP with
In both cases I get |
@kirs Access log is disabled for default server (the 404 server) (you can see that by inspecting the generated Nginx configuration, search for |
Oh, thanks a lot, I've spent like 4 hours trying to find the issue 🤦♂️ It works now 🎉 Do you mind if I add a sample ingress to the dev setup ( |
@kirs I'd think catch all server is a special beast that only minority of ingress-nginx users need/use. I'd instead create an ingress with hostname such as |
Closing. We already have an example to test the ingress controller |
how to create the dummy ingress? I still can't understand. same issue for me, can't see any logs if tail stdout and stderr. |
I dont understand teh relationship between the example and the stdout and stderr logs? could you help me, thanks:) |
@aledbf closing comment is not helping : I'm in the same situation as @mentgmery : I have the same issue than OP, and the closing message talks about "an example to test the ingress controller" which is not related at all. |
@Orabig finally I found the root cause of the problems. even it outputs logs to stdout, it still save the data in the disk. at that time, when i looked into these logs(/var/log/containers), i found logs blank, that was because my docker version is too low, and it was docker's bug to not output the logs. after i upgrade the docker to 18.03, then all works. hope, it can help you:) and i recommend the efk strongly, pls have a look. |
For people ending up here like myself: There is a configmap value that can be set to enable access logs on the default backend, see here: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#enable-access-log-for-default-backend |
What keywords did you search in NGINX Ingress controller issues before filing this one? logs, access_log, /dev/stdout
Is this a BUG REPORT or FEATURE REQUEST?: bug report
NGINX Ingress controller version: 0.19.0 (git-05025d6); nginx/1.15.3
Kubernetes version (use
kubectl version
): v1.9.7-gke.6, v1.10.0, v1.10.6-gke.2, v1.10.7-gke.2Environment:
What happened:
Nginx logs are not reported to stdout of
nginx-ingress-controller
container and therefore are not visible fromkubectl logs
.What you expected to happen:
kubectl logs
fornginx-ingress-controller
pod should include nginxaccess_log
, given that it's access_log is enabled by defaultHow to reproduce it (as minimally and precisely as possible):
After doing a few requests to the service with
curl
, I don't see any nginx logs. I'm using default configuration wherenginx.ingress.kubernetes.io/enable-access-log
is supposed to betrue
by default.Checking if
access_log
is enabled innginx.conf
:access_log
is enabled. Where does it point to?It's linked to
/dev/stdout
, so it should appear in container logs which capture stdout.Anything else we need to know:
Why do I think that access_log is supposed to be in container's stdout? See this gist with logs reported by another user.
Steps I took to try to pin this:
ingress-nginx versions tried:
providers tried:
tried to ssh to the node directly and run
docker logs
, no access logs there eitherThe text was updated successfully, but these errors were encountered: