Python Forum
WatchedFileHandler.reopenIfNeeded() usage
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WatchedFileHandler.reopenIfNeeded() usage
#1
Hi -- I'm trying to figure out the right way to call WatchedFileHandler.reopenIfNeeded() to help reopen a new file if the file was rotated by logrotate:
https://docs.python.org/3/library/loggin...enIfNeeded

I tried this but seems to fail with errors:

handler = logging.handlers.WatchedFileHandler(somefile)
handler.setFormatter(formatter)
handler.reopenIfNeeded()
Thanks!
Reply
#2
(Nov-09-2018, 02:56 AM)buntu Wrote: but seems to fail with errors
What errors, exactly?
Reply
#3
Actually typo in my code, sorry about that.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020