From 50e8875074aa80478b1fb33e070d5169d1e7915d Mon Sep 17 00:00:00 2001 From: Eoin Gallinagh Date: Wed, 2 Mar 2022 14:39:57 +0000 Subject: [PATCH] Change RotationConfig defualtmax file size in FileConfig.java --- .gitignore | 2 +- .../java/io/quarkus/runtime/logging/FileConfig.java | 2 +- .../quarkus/logging/CategoryConfiguredHandlerTest.java | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 2ab436ff74c7f..689e04e34edcd 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,7 @@ ObjectStore .gradle docker/distroless/bazel-* /.apt_generated_tests/ -quarkus.log +quarkus.log* replay_*.logß nbactions.xml nb-configuration.xml diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/FileConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/FileConfig.java index 78bcdb7c7368c..99fa49ba2e84d 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/FileConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/FileConfig.java @@ -58,7 +58,7 @@ public static class RotationConfig { /** * The maximum file size of the log file after which a rotation is executed. */ - @ConfigItem(defaultValueDocumentation = "10") + @ConfigItem(defaultValue = "10M") Optional maxFileSize; /** diff --git a/core/test-extension/deployment/src/test/java/io/quarkus/logging/CategoryConfiguredHandlerTest.java b/core/test-extension/deployment/src/test/java/io/quarkus/logging/CategoryConfiguredHandlerTest.java index 915db742c6c56..040b517e224e2 100644 --- a/core/test-extension/deployment/src/test/java/io/quarkus/logging/CategoryConfiguredHandlerTest.java +++ b/core/test-extension/deployment/src/test/java/io/quarkus/logging/CategoryConfiguredHandlerTest.java @@ -3,11 +3,15 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.Arrays; -import java.util.logging.*; +import java.util.logging.Formatter; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.Logger; import org.jboss.logmanager.formatters.PatternFormatter; import org.jboss.logmanager.handlers.ConsoleHandler; -import org.jboss.logmanager.handlers.FileHandler; +import org.jboss.logmanager.handlers.SizeRotatingFileHandler; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -39,7 +43,7 @@ public void consoleOutputTest() { Logger categoryLogger = logManager.getLogger("io.quarkus.category"); assertThat(categoryLogger).isNotNull(); assertThat(categoryLogger.getHandlers()).hasSize(2).extracting("class").containsExactlyInAnyOrder(ConsoleHandler.class, - FileHandler.class); + SizeRotatingFileHandler.class); Logger otherCategoryLogger = logManager.getLogger("io.quarkus.othercategory"); assertThat(otherCategoryLogger).isNotNull();