From 21f244ff3fd00f5fac19df6effe8924c69712d46 Mon Sep 17 00:00:00 2001 From: RatzzFatzz Date: Tue, 4 Feb 2025 17:48:45 +0100 Subject: [PATCH] Update logging config --- README.md | 2 +- src/main/resources/log4j2-dev.yaml | 12 +++++++++++- src/main/resources/log4j2-installed.yaml | 19 +++++++++++-------- src/main/resources/log4j2.yaml | 12 +++++++++++- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 438b6d0..e56618f 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Windows (installed): `mkvaudiosubtitlechanger.jar --library "X:/Files" --attribu ``` If you need more information how each parameter works, check out [this wiki page](https://github.com/RatzzFatzz/MKVAudioSubtitleChanger/wiki/Parameters-v4). -All parameters can also be defined in a [config file](https://github.com/RatzzFatzz/MKVAudioSubtitleChanger/wiki/How-to-config-file). +All parameters can also be defined in a [config file](https://picocli.info/#_argument_files_for_long_command_lines). ## Build requirements - JDK 21 or newer diff --git a/src/main/resources/log4j2-dev.yaml b/src/main/resources/log4j2-dev.yaml index e2b4377..f3b739f 100644 --- a/src/main/resources/log4j2-dev.yaml +++ b/src/main/resources/log4j2-dev.yaml @@ -10,7 +10,7 @@ Configuration: RollingFile: name: FileAppender fileName: logs/application.log - filePattern: logs/archive/application-%d{yyyy-MM-dd}-%i.log + filePattern: logs/archive/application-%d{yyyy-MM-dd}-%i.log.gz PatternLayout: Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable" ThresholdFilter: @@ -18,6 +18,16 @@ Configuration: Policies: OnStartupTriggeringPolicy: minSize: 0 + DefaultRolloverStrategy: + max: 30 + Delete: + basePath: logs/archive + maxDepth: 1 + IfLastModified: + age: 30d + IfAccumulatedFileSize: + exceeds: 1GB + Loggers: Root: level: debug diff --git a/src/main/resources/log4j2-installed.yaml b/src/main/resources/log4j2-installed.yaml index 17494b5..804ec99 100644 --- a/src/main/resources/log4j2-installed.yaml +++ b/src/main/resources/log4j2-installed.yaml @@ -1,17 +1,10 @@ Configuration: name: DefaultLogger Appenders: - File: - name: FileAppender - fileName: ${sys:user.home}/AppData/Roaming/MyApplication/MyApplication.log - PatternLayout: - Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable" - ThresholdFilter: - level: info RollingFile: name: FileAppender fileName: ${sys:user.home}/AppData/Roaming/MKVAudioSubtitleChanger/logs/application.log - filePattern: ${sys:user.home}/AppData/Roaming/MKVAudioSubtitleChanger/logs/archive/application-%d{yyyy-MM-dd}-%i.log + filePattern: ${sys:user.home}/AppData/Roaming/MKVAudioSubtitleChanger/logs/archive/application-%d{yyyy-MM-dd}-%i.log.gz PatternLayout: Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable" ThresholdFilter: @@ -19,6 +12,16 @@ Configuration: Policies: OnStartupTriggeringPolicy: minSize: 0 + DefaultRolloverStrategy: + max: 30 + Delete: + basePath: logs/archive + maxDepth: 1 + IfLastModified: + age: 30d + IfAccumulatedFileSize: + exceeds: 1GB + Loggers: Root: level: info diff --git a/src/main/resources/log4j2.yaml b/src/main/resources/log4j2.yaml index 7a1dc2d..bfa5dca 100644 --- a/src/main/resources/log4j2.yaml +++ b/src/main/resources/log4j2.yaml @@ -4,7 +4,7 @@ Configuration: RollingFile: name: FileAppender fileName: logs/application.log - filePattern: logs/archive/application-%d{yyyy-MM-dd}-%i.log + filePattern: logs/archive/application-%d{yyyy-MM-dd}-%i.log.gz PatternLayout: Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable" ThresholdFilter: @@ -12,6 +12,16 @@ Configuration: Policies: OnStartupTriggeringPolicy: minSize: 0 + DefaultRolloverStrategy: + max: 30 + Delete: + basePath: logs/archive + maxDepth: 1 + IfLastModified: + age: 30d + IfAccumulatedFileSize: + exceeds: 1GB + Loggers: Root: level: info