From fe74c2d4967178f68e026f00c06c8c01157cd970 Mon Sep 17 00:00:00 2001 From: melloware Date: Fri, 4 Oct 2024 08:22:25 -0400 Subject: [PATCH] LTS 3.15.1 --- .../deployment/LoggingManagerConfig.java | 29 +++++++++++-------- .../deployment/LoggingManagerProcessor.java | 16 +++++----- pom.xml | 6 ++-- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/LoggingManagerConfig.java b/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/LoggingManagerConfig.java index 0d4da7b..8ab9054 100644 --- a/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/LoggingManagerConfig.java +++ b/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/LoggingManagerConfig.java @@ -1,33 +1,38 @@ package io.quarkiverse.loggingmanager.deployment; -import io.quarkus.runtime.annotations.ConfigItem; +import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; +import io.smallrye.config.ConfigMapping; +import io.smallrye.config.WithDefault; +import io.smallrye.config.WithName; -@ConfigRoot -public class LoggingManagerConfig { +@ConfigMapping(prefix = "quarkus.logging-manager") +@ConfigRoot(phase = ConfigPhase.BUILD_TIME) +public interface LoggingManagerConfig { /** * The base path */ - @ConfigItem(defaultValue = "logging-manager") - String basePath; + @WithDefault("logging-manager") + String basePath(); /** * Whether to include the Logger Manager endpoints in the generated OpenAPI document */ - @ConfigItem(name = "openapi.included", defaultValue = "false") - boolean openapiIncluded; + @WithName("openapi.included") + @WithDefault("false") + boolean openapiIncluded(); /** * The tag to use if OpenAPI is included */ - @ConfigItem(defaultValue = "Logging-manager") - String openapiTag; + @WithDefault("logging-manager") + String openapiTag(); /** * Always include this. By default, this will always be included. * Setting this to false will also exclude this in Prod */ - @ConfigItem(defaultValue = "true") - boolean alwaysInclude; -} \ No newline at end of file + @WithDefault("true") + boolean alwaysInclude(); +} diff --git a/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/LoggingManagerProcessor.java b/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/LoggingManagerProcessor.java index 7983408..6441aa6 100644 --- a/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/LoggingManagerProcessor.java +++ b/deployment/src/main/java/io/quarkiverse/loggingmanager/deployment/LoggingManagerProcessor.java @@ -28,7 +28,7 @@ static class OpenAPIIncluded implements BooleanSupplier { LoggingManagerConfig config; public boolean getAsBoolean() { - return config.openapiIncluded; + return config.openapiIncluded(); } } @@ -48,7 +48,7 @@ void includeRestEndpoints(BuildProducer routeProducer, LoggingManagerRuntimeConfig runtimeConfig, ManagementInterfaceBuildTimeConfig managementConfig) { - if ("/".equals(loggingManagerConfig.basePath)) { + if ("/".equals(loggingManagerConfig.basePath())) { throw new ConfigurationException( "quarkus.logging-manager.base-path was set to \"/\", this is not allowed as it blocks the application from serving anything else."); } @@ -59,7 +59,7 @@ void includeRestEndpoints(BuildProducer routeProducer, routeProducer.produce(nonApplicationRootPathBuildItem.routeBuilder() .management() - .routeFunction(loggingManagerConfig.basePath, + .routeFunction(loggingManagerConfig.basePath(), recorder.routeConsumer(bodyHandlerBuildItem.getHandler(), runtimeConfig)) .displayOnNotFoundPage("All available loggers") .handler(loggerHandler) @@ -67,7 +67,7 @@ void includeRestEndpoints(BuildProducer routeProducer, routeProducer.produce(nonApplicationRootPathBuildItem.routeBuilder() .management() - .nestedRoute(loggingManagerConfig.basePath, "levels") + .nestedRoute(loggingManagerConfig.basePath(), "levels") .displayOnNotFoundPage("All available log levels") .handler(levelHandler) .build()); @@ -86,14 +86,14 @@ public void includeInOpenAPIEndpoint(BuildProducer io.quarkiverse quarkiverse-parent - 17 + 18 io.quarkiverse.loggingmanager @@ -31,7 +31,7 @@ 17 UTF-8 UTF-8 - 3.8.5 + 3.15.1 @@ -80,4 +80,4 @@ - + \ No newline at end of file