diff --git a/core/dbt/events/functions.py b/core/dbt/events/functions.py index e749ae6b4a2..c2bbdc41819 100644 --- a/core/dbt/events/functions.py +++ b/core/dbt/events/functions.py @@ -82,7 +82,12 @@ def setup_event_logger(log_path, level_override=None): file_passthrough_formatter = logging.Formatter(fmt=FORMAT) - file_handler = RotatingFileHandler(filename=log_dest, encoding='utf8') + file_handler = RotatingFileHandler( + filename=log_dest, + encoding='utf8', + maxBytes=10 * 1024 * 1024, # 10 mb + backupCount=5 + ) file_handler.setFormatter(file_passthrough_formatter) file_handler.setLevel(logging.DEBUG) # always debug regardless of user input this.FILE_LOG.handlers.clear()