I am running django webapp in vagrant (running ubuntu) on a windows machine. The application has the RotatingFileHandler function installed, which for the most part is registered correctly. But in the end, the log file fills up, and at that moment it cannot roll over
Logged from file util.py, line 79 Traceback (most recent call last): File "/usr/lib/python2.7/logging/handlers.py", line 78, in emit self.doRollover() File "/usr/lib/python2.7/logging/handlers.py", line 141, in doRollover os.rename(self.baseFilename, dfn) OSError: [Errno 26] Text file busy
(many times)
Here is a configuration snippet for RotatingFileHandler:
'default': { 'level':'DEBUG', 'class':'logging.handlers.RotatingFileHandler', 'filename': 'logs/application.log', 'maxBytes': 1024 * 1024 * 5,
The problem is that it is in the public accessible directory, so it is running into Windows file lock problems. If I change it to enter a directory outside the shared directory, it will be turned over.
My question is, is there anything I can do to prevent the error above without moving the exits from the roaming directory?
I would like to keep it there, so that it is more portable for other servers, and so I can view the logs in windows.
source share