stumbleupon/tcollector — pull request #29 by huckphin (2012-03-16 17:30:53+00:00)
Title: Add RotatingFileHandler handler options to tcollector.

While using tcollector we noticed that the operating system (Linux) would keep open the file descriptor for the log file even after the file did not exist. This happens because tcollector does not close its file descriptor when log rotation happens.

This commit has one goal: to ensure that a finite amount of disk space is used for logging, regardless of how the collecting are behaving (or maybe misbehaving).

The commit aims to be compatible with the existing options, but added a few more options to allow the inclusion of a RotatingFileHandler:

* max-bytes: Maximum number of bytes per a logfile to retain (default: 1 million bytes)
* backup-count: Number of logfiles to keep on hand (default: only one log file)
* logfile: log filename (default: /var/log/tcollector.log)

If these options are not given, then it defaults to the existing behavior: using the StreamHandler, which will still write to stdout.