Curious why supervisord wouldn't use python's built-in log file rotation mechanism (e.g., http://docs.python.org/library/logging.html#rotating-file-handler)?
- Rob On Wed, Dec 1, 2010 at 11:46 AM, whit <w...@surveymonkey.com> wrote: > resending with patch heading to follow list convention. > > whit wrote: > > When using a single filename for multiple processes, one may observe the > > following behavior:: > > > > * normal logging until the file reaches maxbytes > > > > * above maxbytes: > > - erratic and prolific creation backups > > - logging to backups > > - backups that are significantly less than maxbytes > > > > What happens here is that os.rename does not close handle other > > RotatingFileHandler instances have open, leaving them to attempt to > > rotate the previously open handle after they log. Since, if I > > understand correctly, open handles track by inode rather than filename, > > already rotated files get written to and erroneously renamed. > > > > A fix for this is contained within the following patches. The first is > > specific to python 2.6, the other should be compatible with any version > > of python that has newstyle classes. I have only tested it with 2.6 and > > 2.7. > > > > Python 2.6 implementation > > > > > https://github.com/SurveyMonkey/supervisor/commit/ce7db09db8ffe1aee269778a187e4c41ff319609 > > > > > > BW compat version > > > > > https://github.com/SurveyMonkey/supervisor/commit/d01dc1a590f1ee662d4f7f619a371959386ee0ea > > > > > > > > -w > > > > > -- > >>> > Whit Morriss > CodeMonkey > w...@surveymonkey.com > > -- We're hiring pythonista: http://bit.ly/cT0ELi -- > > _______________________________________________ > Supervisor-users mailing list > Supervisor-users@lists.supervisord.org > http://lists.supervisord.org/mailman/listinfo/supervisor-users >
_______________________________________________ Supervisor-users mailing list Supervisor-users@lists.supervisord.org http://lists.supervisord.org/mailman/listinfo/supervisor-users