feat: add file-based logging with hourly rotation and configurable retention period

Add LOG_FILE and LOG_RETENTION_HOURS environment variables to .env.example with defaults /data/media-max.log and 6 hours. Install TimedRotatingFileHandler with hourly rotation, 1 backup, UTF-8 encoding, and UTC timestamps. Add OSError exception handling with warning log when file logging unavailable. Add warn_on_nonzero parameter to _read_command() with default True and disable for smartctl -H calls to suppress expected
This commit is contained in:
nessi committed 2026-08-16 12:22:06 +02:00
1 parent 02a5db61be
commit 24b2a3a12f
2 files changed
+15 -4

No files matched your search

+2
View File
@@ -38,4 +38,6 @@ STORAGE_CACHE_SECONDS=900
# Optional: SMART-Abfragen aktivieren (benötigt Zugriff auf Host-Devices)
SMART_ENABLED=false
HOST_SYS_PATH=/host-sys
LOG_FILE=/data/media-max.log
LOG_RETENTION_HOURS=6
LOG_LEVEL=INFO