[Solved]-Problem with Python logging RotatingFileHandler in Django website

8๐Ÿ‘

Iโ€™ve found this behavior when there are multiple precesses are running with your code.

Unfortunatelly no perfect option exists.

Some ideas, you can incorporate are:

  • use WatchedFileHandler (new in 2.6) and rotate with external programs as logrotate
  • use syslog or other log aggregating server
  • use python log aggregation sentry โ€“ this is especially useful with django as you can log not only log messages, but exceptions with full stacktrace and 404s.
๐Ÿ‘คJerzyk

6๐Ÿ‘

Also perhaps this is worth considering http://pypi.python.org/pypi/ConcurrentLogHandler/0.8.3

๐Ÿ‘คkalium

0๐Ÿ‘

Google turns up this answer:

http://bytes.com/topic/python/answers/643884-rotatingfilehandler-bugs-errors-general-logging-question#post2552392

Could it be that you have multiple processes running the logger? Maybe multiple apps logging to the same files?

๐Ÿ‘คDimitry

Leave a comment