<br><br><div><span class="gmail_quote">On 11/21/07, <b class="gmail_sendername">Guilherme Polo</b> <<a href="mailto:ggpolo@gmail.com">ggpolo@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2007/11/21, Vladimir Rusinov <<a href="mailto:vladimir@greenmice.info">vladimir@greenmice.info</a>>:<br>> Hello!<br>><br>> In one my project (it's logfile manager) I want to implement 'smart'<br>
> configuration files, e.g.<br>><br>> logfile("/var/log/messages")<br>> if (size() > 10*1024*1024) and (lavg() < 5):<br>>     execute("my_log_alerter")<br>>    rotate(save=10, compress='bzip2')
<br>><br>> how can I safely do this?<br>><br>logging already provides the rotating<br></blockquote></div><br>Yes, but apache, nginx and others does not uses logger.<br>I wanna write an application which would handle all my (Linux) logs: rotating, compressing, analysing and so on (logrotate replacement), it would require some nontrivial configuration, something like "If size of this log bigger then 2Mb or today is sunday. If size of this log bigger then 30 Mb, and today is not sunday, then rotate it, and make alert".
<br>Is there any module to parse such configuration files?<br clear="all"><br>-- <br>Vladimir Rusinov<br>GreenMice Solutions: IT-решения на базе Linux<br><a href="http://greenmice.info/">http://greenmice.info/</a>