Custom docker container in Kubernetes cluster with log using Stackdriver

37 views
Skip to first unread message

mder...@gmail.com

unread,
Nov 25, 2017, 10:02:03 AM11/25/17
to Kubernetes user discussion and Q&A
Hi,
I would like to know which steps I have to follow in order to send the logs created in my custom apache container (deployed in a pod with Kubernetes) to the Stackdriver collector.
I have noticed that if I create a pod with a standard apache (or nginx) container, access.log and error.log are sent automatically to Stackdriver.
In fact I'm able to see the log both on Kubernetes dashboard and on Google Cloud Dashboard--->Logging--->Logs
Instead I don't see anything related my custom apache...
Any suggestions?

suikoy....@gmail.com

unread,
Nov 26, 2017, 9:16:04 AM11/26/17
to Kubernetes user discussion and Q&A
1) I tried to change httpd.conf in order to use a CustomLog as:

CustomLog "logs/access_log" common

where access_log file is link to /dev/stdout:
lrwxrwxrwx 1 root www-data 11 Nov 26 12:13 access_log -> /dev/stdout


2) or CustomLog as:
CustomLog /proc/self/fd/1 common

considering that /dev/stdout is another link:
lrwxrwxrwx 1 root root 15 Nov 25 15:14 stdout -> /proc/self/fd/1

And the strange thing is that both attempts with a pure apache container are working and I'm able to see the logs in Stackdriver

Instead same configurations in my custom apache and I'm not able to see anything in Stackdriver.

Please, any ideas?

Reply all
Reply to author
Forward
0 new messages