Amandeep Singh
Amandeep Singh

Reputation: 1431

See supervisor executions in console rather than a logfile

Right now when i do sudo supervisorctl restart all all programs restart.Then whatever has been executed by program tracker_asgi_workers is written into worker.log file. I want to see executions in command line prompt in real time like we see when we do python manage.py runserver. What value should i assign to stdout_logfile variable ?

[program:tracker_asgi_workers]
command=/home/datasleek/trackervenv/bin/python /home/datasleek/tracker/manage.py runworker
stdout_logfile = /home/datasleek/tracker/logs/worker.log
process_name=asgi_worker%(process_num)s
numprocs=8
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8                        ; Set UTF-8 as default encoding
autostart=true
autorestart=true
redirect_stderr=True
stopasgroup=true

Upvotes: 1

Views: 4003

Answers (3)

WilliamStam
WilliamStam

Reputation: 304

I think there's a 'sudo supervisorctl tail -f tracker_asgi_workers' (same with starting or stopping 1 service

Upvotes: 0

Emad Rad
Emad Rad

Reputation: 420

You can also print them on your terminal and see what will happen in real time:

stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0

Upvotes: 1

Nafees Anwar
Nafees Anwar

Reputation: 6608

I think you can't do it easily because supervisor processes are meant to run in background. However you can print outputs to log file on console in realtime.

Start process managed by supervisor just as normally you do, and run this command to see real time output on console.

 tail -f /home/datasleek/tracker/logs/worker.log

Upvotes: 1

Related Questions