From aeeb6af3242c34800c55a0cb3a51d9b3b0ccc53b Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Mon, 20 Nov 2023 20:11:53 +0100 Subject: [PATCH] Fix for access-log feature. (#8041) Correct config prefix/id, and added provides for the service. Signed-off-by: Tomas Langer --- .../todo-app/frontend/src/main/resources/application.yaml | 2 ++ .../helidon/webserver/accesslog/AccessLogFeatureProvider.java | 4 ++-- webserver/access-log/src/main/java/module-info.java | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/todo-app/frontend/src/main/resources/application.yaml b/examples/todo-app/frontend/src/main/resources/application.yaml index 5ba3e8236bd..d546b220f37 100644 --- a/examples/todo-app/frontend/src/main/resources/application.yaml +++ b/examples/todo-app/frontend/src/main/resources/application.yaml @@ -18,6 +18,8 @@ env: docker server: port: 8080 features: + access-log: + enabled: true security: paths: - path: "/api/{+}" diff --git a/webserver/access-log/src/main/java/io/helidon/webserver/accesslog/AccessLogFeatureProvider.java b/webserver/access-log/src/main/java/io/helidon/webserver/accesslog/AccessLogFeatureProvider.java index 98fc9f9b18a..0876b8b5ca0 100644 --- a/webserver/access-log/src/main/java/io/helidon/webserver/accesslog/AccessLogFeatureProvider.java +++ b/webserver/access-log/src/main/java/io/helidon/webserver/accesslog/AccessLogFeatureProvider.java @@ -21,7 +21,7 @@ import io.helidon.webserver.spi.ServerFeatureProvider; /** - * {@link java.util.ServiceLoader} provider implementation for context feature for {@link io.helidon.webserver.WebServer}. + * {@link java.util.ServiceLoader} provider implementation for access log feature for {@link io.helidon.webserver.WebServer}. */ @Weight(AccessLogFeature.WEIGHT) public class AccessLogFeatureProvider implements ServerFeatureProvider { @@ -36,7 +36,7 @@ public AccessLogFeatureProvider() { @Override public String configKey() { - return "context"; + return "access-log"; } @Override diff --git a/webserver/access-log/src/main/java/module-info.java b/webserver/access-log/src/main/java/module-info.java index e0351ee7c70..7923a0770f5 100644 --- a/webserver/access-log/src/main/java/module-info.java +++ b/webserver/access-log/src/main/java/module-info.java @@ -38,4 +38,7 @@ exports io.helidon.webserver.accesslog; + provides io.helidon.webserver.spi.ServerFeatureProvider + with io.helidon.webserver.accesslog.AccessLogFeatureProvider; + } \ No newline at end of file