mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 15:26:10 -04:00
SYN-142: Rotate logs if logging to file. Fixed to a 4 file rotate with 100MB/file for now.
This commit is contained in:
parent
7f83613733
commit
9d0dcf2e3c
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue