aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/quote_parsing/__main__.py2
-rw-r--r--python/utils/__init__.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/python/quote_parsing/__main__.py b/python/quote_parsing/__main__.py
index 9b3f9937..0540f90c 100644
--- a/python/quote_parsing/__main__.py
+++ b/python/quote_parsing/__main__.py
@@ -12,7 +12,7 @@ from . import logger
from .download_emails import save_emails
from .parse_emails import parse_email, write_todb
-fh = SerenitasRotatingFileHandler("emails_parsing.log", 1_000_000)
+fh = SerenitasRotatingFileHandler("emails_parsing.log", 1_000_000, 5)
logger.addHandler(fh)
logger.setLevel(logging.WARNING)
diff --git a/python/utils/__init__.py b/python/utils/__init__.py
index c7faf097..f186a8b2 100644
--- a/python/utils/__init__.py
+++ b/python/utils/__init__.py
@@ -18,8 +18,10 @@ class SerenitasFileHandler(logging.FileHandler):
class SerenitasRotatingFileHandler(logging.handlers.RotatingFileHandler):
"""simple class that encapsulates where we store our logs"""
- def __init__(self, log_file, maxBytes=0):
+ def __init__(self, log_file, maxBytes=0, backupCount=0):
super().__init__(
- filename=os.path.join(os.getenv("LOG_DIR"), log_file), maxBytes=maxBytes
+ filename=os.path.join(os.getenv("LOG_DIR"), log_file),
+ maxBytes=maxBytes,
+ backupCount=backupCount,
)
self.setFormatter(SerenitasFileHandler._formatter)