From b2758964df55e918ce483ffdc1e72ab603781bb5 Mon Sep 17 00:00:00 2001 From: levinster82 Date: Fri, 12 Sep 2025 22:32:52 +0000 Subject: [PATCH] Configure log rotation for frigate.log ## Size-based rotation: - When frigate.log reaches 100MB, it rotates immediately ## Time-based rotation: - Daily at midnight (default logback behavior) ## How it works: 1. **During operation**: If the file hits 100MB, it gets rotated right away to `frigate.YYYY-MM-DD.0.log.gz` 2. **Daily**: Even if the file is smaller than 100MB, it rotates at midnight to `frigate.YYYY-MM-DD.0.log.gz` 3. **Multiple rotations per day**: If the file hits 100MB multiple times in one day, you get `frigate.YYYY-MM-DD.0.log.gz`, `frigate.YYYY-MM-DD.1.log.gz`, etc. ## Cleanup: - Keeps 30 days of rotated logs - Maximum 3GB total log storage - Old files are automatically deleted --- src/main/resources/logback.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index e38b362..68799f0 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -11,8 +11,14 @@ frigate - + ${appDir}/frigate.log + + ${appDir}/frigate.%d{yyyy-MM-dd}.%i.log.gz + 100MB + 30 + 3GB + %date %level [%thread] %logger{10} [%file:%line] %msg%n @@ -28,4 +34,4 @@ - \ No newline at end of file +