Skip to content

Commit

Permalink
Merge pull request #4764 from xoriole/flush-logs
Browse files Browse the repository at this point in the history
Flush logs before shutting down
  • Loading branch information
qstokkink authored Aug 23, 2019
2 parents 16cbbff + d975c08 commit 23e7f35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tribler/Core/Modules/restapi/shutdown_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def shutdown_process(_, code=1):
reactor.addSystemEventTrigger('after', 'shutdown', os._exit, code)
reactor.stop()
self.process_checker.remove_lock_file()
# Flush the logs to the file before exiting
for handler in logging.getLogger().handlers:
handler.flush()

def log_and_shutdown(failure):
self._logger.error(failure.value)
Expand Down

0 comments on commit 23e7f35

Please sign in to comment.