On Nov 21, 12:44 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2007/11/21, Vladimir Rusinov <[EMAIL PROTECTED]>: > > > Hello! > > > In one my project (it's logfile manager) I want to implement 'smart' > > configuration files, e.g. > > > logfile("/var/log/messages") > > if (size() > 10*1024*1024) and (lavg() < 5): > > execute("my_log_alerter") > > rotate(save=10, compress='bzip2') > > > how can I safely do this? > > > -- > > Vladimir Rusinov > > GreenMice Solutions: IT-ÒÅÛÅÎÉÑ ÎÁ ÂÁÚÅ Linux > > http://greenmice.info/ > > -- > >http://mail.python.org/mailman/listinfo/python-list > > logging already provides the rotating > > from logging.handlers import RotatingFileHandler > help(RotatingFileHandler) > > -- > -- Guilherme H. Polo Goncalves
But the original RotatingFileHanlder does not offer compressing facility where the sample code that the author provides seems to indicate that he wants some sort of handling on that... Extends the class and override the doRollover method would probably do what you need. -- http://mail.python.org/mailman/listinfo/python-list