[uWSGI] still fighting with uwsgi log file rotation (without having to restart workers and daemons)

Gelonida gelonida at gmail.com
Tue Nov 7 08:23:49 UTC 2017


Hi guys,

I'm still stuck with this.

Can anybody help out?


I would like to rotate the uwsgi log file on demand without having to 
restart uwsgi or any of its attached daemons.

My setup (removed some in my opinion irrelevant lines:

>  workers = 3
>  master = true
>  daemonize = /var/log/uwsgi/file1.log
>  logto2 = /var/log/uwsgi/file2.log
>  log-reopen = yes
>  touch-logreopen=/tmp/uwsgi.pls_rotateme
>  attach-daemon = custom_daemon/writing_to_stdout_and_stderr
>  attach-daemon = celery_writing_to_stdout_and_stderr

When I rename /var/log/uwsgi/file2.log with a

> mv /var/log/uwsgi/file2.log /var/log/uwsgi/file2.log.old
>

and touch tmp/uwsgi.pls_rotateme, I can observe that a new log file is 
created, however some of my processes (the attached daemons) still write 
into the old log file.


How can I avoid this, What am I doing wrong?

Can  I use something a socket logger (that writes in its turn to a file 
and that can be lo rotated)?
Or shall I just redirect each daemon's stdout / stderr to a separate 
file. (And how to logrotate stdout / stderr then for these processes)



Thanks in advance for any suggestions,





_______________________________________________
uWSGI mailing list
uWSGI at lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi


More information about the uWSGI mailing list