> I've got an application running on linux which writes log files using the > python logging module. I'm looking for some help and advice to cap the size > which the file will grow too, something reasonably like 2Mb would be great. > > > > What is the best way to handle this kind of thing? Can this be done using a > setting in the logging module? Or is it something I'll have to get the FS to > handle for me?
Check out the RotatingFileHandler: http://docs.python.org/lib/node413.html It is part of the logging module and should do what you want. Examples of using alternative handlers are here: http://docs.python.org/lib/multiple-destinations.html Matt -- http://mail.python.org/mailman/listinfo/python-list