Skip to content
Snippets Groups Projects
Commit 9d0dcf2e authored by Kegan Dougal's avatar Kegan Dougal
Browse files

SYN-142: Rotate logs if logging to file. Fixed to a 4 file rotate with 100MB/file for now.

parent 7f836137
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,10 @@ class LoggingConfig(Config): ...@@ -66,7 +66,10 @@ class LoggingConfig(Config):
formatter = logging.Formatter(log_format) formatter = logging.Formatter(log_format)
if self.log_file: if self.log_file:
handler = logging.FileHandler(self.log_file) # TODO: Customisable file size / backup count
handler = logging.handlers.RotatingFileHandler(
self.log_file, maxBytes=(1000 * 1000 * 100), backupCount=3
)
else: else:
handler = logging.StreamHandler() handler = logging.StreamHandler()
handler.setFormatter(formatter) handler.setFormatter(formatter)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment