On 2/8/07, <b class="gmail_sendername">Martin Evans</b> &lt;<a href="mailto:martin@browns.co.uk">martin@browns.co.uk</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Are there any samples on how best to interact with logging?<br><br>My server needs to log quite a few items, as such the log file is<br>growing quite quickly and I would like to be able to switch file<br>names on a daily basis. I would also probably then wish to delete
<br>logs older than 14 days.<br><br>I&#39;m not sure how safe it would be to just keep calling startLogging()<br>with a different file name mid-session. I realise there has been some<br>discussion about this area recently.
</blockquote><div><br>From a quick look at log.py it does not appear that calling
startLogging again would stop logging to the old, it would just add
another log observer, meaning that log entries would go to both files.<br>
<br>One approach is to create your own log observer and using this to log with. Then you can change file whenever you want to, and also change the log layout etc.. Alternatively you can call removeObserver and addObserver when you want to change log file.
<br><br>Another approach is to use an external program to rotate the log files.<br></div></div><br>-- <br>&nbsp;&nbsp; - Henrik