Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can docker have multiple logging drivers?

is it possible to use multiple logging drivers for the same container - say fluentd and json?

Thank you.

like image 658
qubsup Avatar asked Jul 12 '17 10:07

qubsup


People also ask

Can a docker container have multiple applications?

It's ok to have multiple processes, but to get the most benefit out of Docker, avoid one container being responsible for multiple aspects of your overall application. You can connect multiple containers using user-defined networks and shared volumes.

Are docker logs persistent?

Docker collects logs from the standard output and error (stdout and stderr) streams of the foreground processes of your containers. These logs are sent to the selected logging driver—more on these below—to be stored persistently.

What is docker logging?

The docker logs command shows information logged by a running container. The docker service logs command shows information logged by all containers participating in a service. The information that is logged and the format of the log depends almost entirely on the container's endpoint command.

What are the different levels of logs in docker enterprise?

There are two levels of aggregation in Docker logging. One refers to the logs from inside the container in your Dockerized application, and the second refers to the logs from the host servers (that is system logs or Docker daemon logs), which are generally located in /var/log .


2 Answers

As of 18.03, Docker Engine Enterprise(EE) supports multiple log drivers, but it is not in the Community Edition(CE):

https://docs.docker.com/ee/engine/release-notes/#18031-ee-1-2018-06-27

like image 187
arueth Avatar answered Sep 23 '22 21:09

arueth


No, you can only specify a single logging driver/container.

To have separate sinks for your logs, you'd have to rely on something like fluentd to receive the logs (or read the json log files) and configure a pipeline to distribute them.

like image 27
kewne Avatar answered Sep 21 '22 21:09

kewne