Docker Community Forums

Share and learn in the Docker community.

Journald logging option in docker-compose file


(Rajagola) #1

Hi,

I’m trying to specify journald as logging driver for my container. I want to specify the option in docker-compose.yml file. In this link https://docs.docker.com/compose/yml/ , I could find options only for syslog, json and none.

How do i specify it for journald.

#my docker compose file
db:
image: postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- /root/docker-django-app:/code:z
ports:
- "8000:8000"
links:
- db
logging_driver: “journald”


(Naoko Reeves) #2

Should be something like this

myapp:
  logging:
    driver: journald

doc is located here: https://docs.docker.com/compose/compose-file/compose-file-v2/#logging