Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RotatingFileHandler Logging fixes #10

Closed
wants to merge 2 commits into from

Conversation

whitmo
Copy link

@whitmo whitmo commented Mar 29, 2011

Currently if you spawn multiple processes and wish to log to the same file, the filedescriptors will not be changed as the files are filled up and renamed leading to an explosion of inconsistent behavior once a file size limit is reached (every process will again check the original file, and try to spawn a new file to which to log).

These commits create a descriptor that manages the 'stream' from a list of open file handles stored in a module global insure across multiple RFHandlers only one set of rotated files exists per filename. Tests included.

@mnaberez
Copy link
Member

We should merge this or a variation of it before the next release.

@whitmo
Copy link
Author

whitmo commented Nov 14, 2011

ok, will do my due dilligence.

-w

On Thu, Nov 10, 2011 at 11:53 PM, Mike Naberezny
reply@reply.github.com
wrote:

We should merge this or a variation of it before the next release.


Reply to this email directly or view it on GitHub:
#10 (comment)

<=>
david "whit" morriss

 "If you don't know where you are,
  you don't know anything at all"

  Dr. Edgar Spencer, Ph.D., 1995

@mnaberez
Copy link
Member

This was released in 3.0b1 last week but looks like we missed a bug (see #130 and #121) that causes supervisord to crash when supervisorctl reload is issued. I think this is because when a stream is closed, it is left in the open_streams dictionary.

@mcdonc
Copy link
Member

mcdonc commented Dec 27, 2012

Houston, I think we have a problem even if we fix the file reference counting issue:

  [program:theprogramname]
  command=/bin/cat /dev/urandom
  stdout_logfile=/tmp/theprogramname.log
  stdout_logfile_maxbytes=1MB
  stdout_logfile_backups=10

  [program:theprogramname2]
  command=/bin/cat /dev/urandom
  stdout_logfile=/tmp/theprogramname.log
  stdout_logfile_maxbytes=2MB
  stdout_logfile_backups=5

That configuration can't be serviced properly when streams are shared because it's logically impossible to have the same file max out at both 1MB and 2MB or have both 10 backups and 5. Even if the maxbytes and the backups numbers are the same, the doRollover method of the handlers attached to each logger is going to clobber files in a bizarre way.

Maybe the feature added by this pull request should be reverted and we should instruct folks to use the recently added syslog logger if they want to multiplex multiple outputs into a single file.

@mnaberez
Copy link
Member

Maybe the feature added by this pull request should be reverted and we should instruct folks
to use the recently added syslog logger if they want to multiplex multiple outputs into a single file.

I think this may be the right thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants