1

I want to send all logs from docker postgresql container to my host journald service.

i.e. I want to be able to read docker container logs at host machine using tail -f /var/logs/messages or journald -f

here is my docker-compose config:

  postgres:
    restart: unless-stopped
    image: postgres:9.6
    ports:
      - "5432:5432"
    logging:
      driver: syslog
      options:
        syslog-address: "udp://127.0.0.1:514"

I've been trying different solutions but everytime i got an error from docker:

postgres_1  | WARNING: no logs are available with the 'syslog' log driver

and I cannot get see logs on the host machine.

I'm not sure, what I'm doing wrong?

Thank you in advance

Vlad
  • 947
  • 1
  • 10
  • 24

1 Answers1

2

For now, docker-compose does not support any logs driver except json-file and journald https://github.com/docker/compose/blob/master/compose/container.py#L173

But journald still does not post anything to host machine it just prints everything to the screen withoud -d options. I think that's build in behavior you cannot change

Vlad
  • 947
  • 1
  • 10
  • 24