[python-win32] Logging Under Windows

Tim Roberts timr at probo.com
Thu Nov 14 19:09:33 CET 2013


Stanley Brinkerhoff wrote:
> I have a rough service application template [1] that I am using for
> multiple projects.  These projects all log to a directory using a date
> based logger that is running in a dedicated thread with a queue.  This
> allows multithreaded services to properly log and not retain multiple
> file handles to the log file.
>
> Every couple days the log rollover fails.  When the logging fails the
> current log file is no longer present, and no future log messages are
> retained.

How is the rollover done?  Close, Rename, Reopen?  Is the log stored on
a network share?  There can be unexpected latencies when doing file
system operations across a network share.  You might consider
eliminating a rename, so that you just close the current log file and
open a new one with the date embedded in the name.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list