Output colored logs from django through supervisor and docker-compose

This page summarizes the projects mentioned and recommended in the original post on /r/codehunter

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • python-colorlog

    A colored formatter for the python logging module

  • [supervisord]http\_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)stdout\_logfile=/dev/stdoutstdout\_logfile\_maxbytes=0stderr\_logfile=/dev/stderrstderr\_logfile\_maxbytes=0[program:gunicorn\_core\_service]#environment=myapp\_VENV=/opt/myapp/venv/environment=PYTHONPATH=/opt/myapp/myappServer/myappServercommand = /opt/myapp/venv/bin/gunicorn wsgi -b 0.0.0.0:8000 --timeout 90 --access-logfile /dev/stdout --error-logfile /dev/stderrdirectory = /opt/myapp/myappServeruser = rootautostart=trueautorestart=trueredirect\_stderr=truestdout\_logfile=/dev/stdoutstdout\_logfile\_maxbytes=0stderr\_logfile=/dev/stderrstderr\_logfile\_maxbytes=0[program:django-celery]command=/opt/myapp/venv/bin/python ./manage.py celery --app=myappServer.celeryapp:app worker -B --loglevel=INFOdirectory=/opt/myapp/myappServernumprocs=1stdout\_logfile=/dev/stdoutstdout\_logfile\_maxbytes=0stderr\_logfile=/dev/stderrstderr\_logfile\_maxbytes=0redirect\_stderr=trueautostart=trueautorestart=truestartsecs=10[program:nginx]command=nginx -g "daemon off;"#user = rootautostart=trueautorestart=trueredirect\_stderr=truestdout\_logfile=/dev/stdoutstdout\_logfile\_maxbytes=0stderr\_logfile=/dev/stderrstderr\_logfile\_maxbytes=0 5. Since docker can only log once process, the logs of all the process of my container are forwarded to /dev/stdout and /dev/stderr 6. And I use colorlog as color formatter to colorize Django logs:

  • Docker Compose

    Define and run multi-container applications with Docker

  • tty: true in my services as described here, but it seems it doesn\'t work anymore.Any idea?

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts