fix: rotate wecker.log to prevent unbounded growth
This commit is contained in:
@@ -6,14 +6,18 @@ import random
|
||||
import sys
|
||||
import os
|
||||
import fcntl
|
||||
from logging.handlers import RotatingFileHandler
|
||||
|
||||
from common import PID_FILE
|
||||
|
||||
# Configure logging
|
||||
# Configure logging with rotation to avoid unbounded growth on the SD card.
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s - %(message)s",
|
||||
handlers=[logging.FileHandler("wecker.log"), logging.StreamHandler()],
|
||||
handlers=[
|
||||
RotatingFileHandler("wecker.log", maxBytes=1_000_000, backupCount=3),
|
||||
logging.StreamHandler(),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user