I've got a container which logs normally through the standard Docker drivers. I've now run this container on GCP via the gcloud compute instances create-with-container command, and I want to see the logs in Stackdriver. Right now, they do not appear.
From what I can tell, combining the advice from here and here, I have to start the host instance, set the default logging driver to GCP by editing docker's daemon.json, and then restart the host instance.
Is this truly the easiest way to get these containers to log to the normal standard google cloud logging solution? I think that gcloud compute instances create-with-container should do this by default, and that I'm missing something.
Okay, turns out the Stackdriver logger does work nicely by default when using gcloud compute instances create-with-container, so your logs should appear automatically.
They didn't for me because it seems that an f1-micro instance doesn't have the grunt to spin up a container that does even a small amount of work on top of the Docker overhead - switching to a g1-small fixed this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With