Friday, December 21, 2018

Re: Is Django logging multi-process safe?

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 <dansmood@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:


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+unsubscribe@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/b1792c98-0373-42e6-93ac-8b0961ec83e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment