From 6a3274f36d701fc3a400583523d70ce6d454da4e Mon Sep 17 00:00:00 2001 From: Tim Heckman <60020185+t2h6@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:05:40 -0800 Subject: [PATCH] Add an SdkHarnessOption that controls whether logging is redirected through the FnApi logging service. Redirection through the FnApi is enabled by default. --- .../org/apache/beam/sdk/options/SdkHarnessOptions.java | 8 ++++---- .../beam/fn/harness/logging/LoggingClientFactory.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/options/SdkHarnessOptions.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/options/SdkHarnessOptions.java index 26d7bab323e1..0656fedbaca1 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/options/SdkHarnessOptions.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/options/SdkHarnessOptions.java @@ -110,12 +110,12 @@ enum LogLevel { void setLogMdc(boolean value); - /** This option controls whether logging will be redirected through the logging service. */ - @Description("Controls whether logging will be redirected through the logging service.") + /** This option controls whether logging will be redirected through the FnApi. */ + @Description("Controls whether logging will be redirected through the FnApi.") @Default.Boolean(true) - boolean getEnableLoggingService(); + boolean getEnableLogViaFnApi(); - void setEnableLoggingService(boolean enableLoggingService); + void setEnableLogViaFnApi(boolean enableLogViaFnApi); /** * Size (in MB) of each grouping table used to pre-combine elements. Larger values may reduce the diff --git a/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/logging/LoggingClientFactory.java b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/logging/LoggingClientFactory.java index b129d0988f97..cfecbe15371c 100644 --- a/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/logging/LoggingClientFactory.java +++ b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/logging/LoggingClientFactory.java @@ -23,7 +23,7 @@ public static LoggingClient createAndStart( PipelineOptions options, Endpoints.ApiServiceDescriptor apiServiceDescriptor, Function channelFactory) { - if (options.as(SdkHarnessOptions.class).getEnableLoggingService()) { + if (options.as(SdkHarnessOptions.class).getEnableLogViaFnApi()) { return BeamFnLoggingClient.createAndStart(options, apiServiceDescriptor, channelFactory); } else { return new NoOpLoggingClient();