flock experience

Robin Becker robin at jessikat.fsnet.co.uk
Tue Jan 14 06:10:14 EST 2003


In message <20030114115047.F349 at prim.han.de>, holger krekel
<pyth at devel.trillke.net> writes
..
.....
>ation using
>> 
>>         f = open(logfile, "a")
>>         f.write(text)
>>         f.close()
>
>If you have the freedom to choose the logfilename then why
>not use a new filename for *each* message?  (that was my
>suggestion).  You might want to prepend a timestamp
>if you can't reliably access 'mtime' on that machine. 
>Reading all the messages in and sorting them is easy.
>
>This is way simpler than any locking scheme. 
>
>    holger
>
Probably you're right, but this site gets thousands of hits and working
with so many files is a pain. We do have separate files in the output
(for obvious reasons) and even the cleanup of files more than one day
old takes a considerable time to complete. I will push this idea and see
what the  response is. Our analysis tool already takes a while to
process the logs and it's only statting to see which files need to be
scanned.
-- 
Robin Becker





More information about the Python-list mailing list