How to rebuild the log file in Python?
<p>Program A by Python:</p>

<pre><code>LOG_PATH = fdoc_log + "/store_plus.log"
 FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
 logging.basicConfig(filename=LOG_PATH, filemode = 'w', level=logging.DEBUG, format=FORMAT)
</code></pre>

<p>Program B by bash:</p>

<pre><code> mv store_plus.log store_plus.log.bk
</code></pre>

<p>The Program A will run in the background and don't stop. When 
the Program B delete the file  of store_plus.log, the Program A can't write log as well.
If I want the Program A rebuild the store_plus.log, How to solve it ?
Thank you</p>

<p>PS: the way :</p>

<pre><code> f = open(LOG_PATH, "a")
 f.close()
</code></pre>

<p>It can't work.</p>
