logging.handlers.RotatingFileHandler needs replacement

NEW
Unassigned

Status

Testing
ActiveData
3 years ago
2 years ago

People

(Reporter: ekyle, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
logging.handlers.RotatingFileHandler is inelegant and prone to failure.  Inelegant in that it simply appends ".NN" to the filename, resulting in the filetype suffix being lost in the name.  Prone to failure because it does not have sufficient mitigation strategies in the case of accidentally locked files.

> Traceback (most recent call last):
>   File "c:\PyPy27\lib-python\2.7\logging\handlers.py", line 78, in emit
>     self.doRollover()
>   File "c:\PyPy27\lib-python\2.7\logging\handlers.py", line 141, in
>     doRollover
>     os.rename(self.baseFilename, dfn)
> WindowsError: [Error 32] The process cannot access the file because it
> is being used by another process

Make a new log writer that takes all the same parameters and writes logs in <filename><date>.<filetype> format to mitigate the locked file problem.  And should the locked file problem happen, move to a new file.
(Reporter)

Updated

2 years ago
Assignee: nobody → klahnakoski
Component: Metrics → ActiveData
Product: Datazilla → Testing
(Reporter)

Updated

2 years ago
No longer blocks: 962378
(Reporter)

Updated

2 years ago
Assignee: klahnakoski → nobody
You need to log in before you can comment on or make changes to this bug.