New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging failes for rotating file log (during rollOver) #40174
Comments
I have a problem with the python logging. The attached Everything works, if the line 'log.refresh' is commented Traceback (most recent call last):
File "log.py", line 21, in ?
log.logger.info(" I am line "+str(i))
File "C:\Python23\lib\logging\__init__.py", line 893, in
info
apply(self._log, (INFO, msg, args), kwargs)
File "C:\Python23\lib\logging\__init__.py", line 994, in
_log
self.handle(record)
File "C:\Python23\lib\logging\__init__.py", line 1004, in
handle
self.callHandlers(record)
File "C:\Python23\lib\logging\__init__.py", line 1037, in
callHandlers
hdlr.handle(record)
File "C:\Python23\lib\logging\__init__.py", line 592, in
handle
self.emit(record)
File "C:\Python23\lib\logging\handlers.py", line 105, in
emit
self.doRollover()
File "C:\Python23\lib\logging\handlers.py", line 90, in
doRollover
os.rename(self.baseFilename, dfn)
OSError: [Errno 13] Permission denied PS: Sometimes I also get the error 'ValueError: I/O |
Logged In: YES Windows is unique in that it will not allow renaming (or You're also adding an endless number of redundant handlers
self.logger = None
if self.logger is not None:
self.rotatingFileLogHandler.close()
self.logger.removeHandler(self.rotatingFileLogHandler) Closing the old handler arranges to close the C:\log.txt file, so |
Logged In: YES Thanks Tim, this solved the problem. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: