python safe scripting

Guilherme Polo ggpolo at gmail.com
Wed Nov 21 21:44:26 CET 2007


2007/11/21, Vladimir Rusinov <vladimir at greenmice.info>:
> 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


More information about the Python-list mailing list