Reputation: 1001
I have an instance group of Container VMs
running my app on a docker container.
I am trying to find a good strategy to manage the application logs for docker + MEAN + Google Cloud Compute Machines
.
I can see the logs on individual containers running docker logs [container_id]
.
However, if I stop and start the VM I lose those logs. I also have VMs dynamically added by Auto scaler
and would like to have a convenient way to access the logs.
Stack is MEAN
and Logging tool is bunyan
.
Is is possible to centralize or combine the logs from all VMS in one persistent location?
any suggestions?
UPDATES:
I installed fluentd
agent and now I can see logs when I manually run thins on the shell: logger "some message for testing"
However, the logs from my container vm
from my docker container never shows up on logs.
I still don't know how to get those docker logs to turn up on google cloud logs. It is supposed to be automatically collected.
cheers Leo
Upvotes: 3
Views: 918
Reputation: 4948
Here is a yaml, Dockerfile and conf for a fluentd pod inside kubernetes.
Adjust the yaml to mount a disk: https://github.com/GoogleCloudPlatform/kubernetes/tree/master/contrib/logging/fluentd-sidecar-gcp
Then adjust the config to log to the disk.
Build the container with the new configuration.
Deploy the new container.
Upvotes: 2