0

On the google container engine, my cluster ships container stdout and stderr to google cloud logging.

Is there any way that I can change the logging output to be consumed by a syslog server or an external entity?

1 Answer 1

1

Google Container Engine gives you two choices for logging: Google Cloud Logging or none. If you don't want to use Google Cloud Logging, you should configure custom logging in your cluster.

There are a couple of ways that you can go about this. You could run a pod per host with your logging agent inside of it and capture logs from any containers that run on the host. This is how Google Container Engine collects logs (using fluentd to send logs to Google Cloud Logging).

You could also configure each of the pods that you want logs from to have a sidecar logging container. This results in many more logging agents running in your system, but gives you the flexibility to customize them for each of your applications.

Sign up to request clarification or add additional context in comments.

2 Comments

How do I run a pod per host in order to collect the logs? Wouldn't the logs stdout/stderr be outside of the boundaries of the Pod? Or is there a shared mount trick that I am missing?
Docker stores logs from containers in /var/lib/docker/containers/*/*-json.log. Kubelet also creates symlinks so that the logs are available at /var/log/containers/. You will need to mount the directories in your pod (logging agent) to access them. See the example in getting-started-guide/logging.md for more details.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.