Hi,

If you are running on a Linux system, you'd better using the standard stream 
logs and logrotate to manage file rotating.


The later is the blessed tool for this kind of task, since it manages for free 
the compression of rotated files and removal of oldest ones if you want to.


Regards


Eric


________________________________
From: django-users@googlegroups.com <django-users@googlegroups.com> on behalf 
of Dan Davis <dansm...@gmail.com>
Sent: Friday, December 21, 2018 5:55:35 PM
To: Django users
Subject: Re: Is Django logging multi-process safe?

Looks like I should use a WatchedFileHandler and then have logrotate do the 
logging.   If the file pointer is moved by another process, then it will work.
Does gunicorn patch this for me?   Will I be better off using syslog or 
something?

On Friday, December 21, 2018 at 11:51:16 AM UTC-5, Dan Davis wrote:

I just came across this:

https://docs.python.org/3.5/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes

This suggests that log messages sent to a StreamHandler will be processed 
properly, but log messages sent to a standard 
logging.handlers.TimedRotatingFileHandler are not process safe.

What sayeth the group?


--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1792c98-0373-42e6-93ac-8b0961ec83e6%40googlegroups.com<https://groups.google.com/d/msgid/django-users/b1792c98-0373-42e6-93ac-8b0961ec83e6%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/AM6P193MB042177E51A91076EAC03931E8CB80%40AM6P193MB0421.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.

Reply via email to