Skip to content

Commit

Permalink
Rotate logfile at midnight
Browse files Browse the repository at this point in the history
  • Loading branch information
cornzz committed Aug 14, 2024
1 parent 2f2d430 commit f9ff9d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def build_logger(logger_name, logger_directory, logger_filename):
if logger_directory != "":
os.makedirs(logger_directory, exist_ok=True)
filename = os.path.join(logger_directory, logger_filename)
handler = logging.handlers.TimedRotatingFileHandler(filename, when="D", encoding="utf-8")
handler = logging.handlers.TimedRotatingFileHandler(filename, when="midnight", encoding="utf-8")
handler.setFormatter(formatter)

for l in [stdout_logger, stderr_logger, logger]:
Expand Down

0 comments on commit f9ff9d6

Please sign in to comment.