How to view container stdout log message

1/6/2018

I my nginx container access log linked to stdout. when I use kubect logs command not its not listing the access log information.

What is the right way to look at access logs?

ls -ltr /var/log/nginx/access.log
lrwxrwxrwx    1 root     root            11 Dec 24 23:41 /var/log/nginx/access.log -> /dev/stdout

Thanks SR

-- sfgroups
kubernetes

1 Answer

1/6/2018

I believe is a problem related with Docker. You can find more information here, but basically, it seems that you have to symlink to /proc/1/fd/1, instead of just /dev/stdout. But this will only work if the nginx process is the pid 1 inside the container. This comment has the more information.

-- Jose Armesto
Source: StackOverflow