Search code examples
pythoncherrypylogging

Python Cherrypy Access Log Rotation


If I want the access log for Cherrypy to only get to a fixed size, how would I go about using rotating log files?

I've already tried http://www.cherrypy.org/wiki/Logging, which seems out of date, or has information missing.


Solution

  • Look at http://docs.python.org/library/logging.html.

    You probably want to configure a RotatingFileHandler

    http://docs.python.org/library/logging.html#rotatingfilehandler