How to send all Docker logs to Graylog

Viewed 825

I am trying to send all logs (exceptions too) to Graylog, but; for example, if there are some mistakes in logback.config file or JVM argument syntax error, I can't see in Graylog stream.

Here is docker-compose.yml;

logging:
  driver: gelf
  options:
    gelf-address: "tcp://graylogHost:graylogPort"
1 Answers

It looks like you have to use UDP instead of TCP.

logging:
      driver: gelf
      options:
        gelf-address: "udp://graylogHost:graylogUDPPort"

But it supports TCP too according to documentation.

https://docs.docker.com/config/containers/logging/gelf/

My advise, don't use TCP, because it's waiting an answer from connection that between container, naturally, and if one of containers is down somehow, it will effect graylog performance.

Related