Can I configure the docker fluentd log driver to connect directly to a container?

Viewed 151

I have fluentd working with --log-opt fluentd-address=localhost:24224, and I have the fluentd daemon running inside a container that itself binds to the port on localhost.

Is it possible to configure the fluentd log driver to route directly to the container (without routing first to localhost). This is useful for swarm mode when I have multiple stacks and I'd like each application stack to have its own fluentd container.

1 Answers

Partial answer to my own question. In swarm mode I can use the Ports long syntax mode: host option to bind fluentd to the actual worker node rather than the ingress mesh.

It's only a partial solution - Ideally I'd only allow containers within the overlay network to connect to the fluentd instance.

Related