Seen a similar question asked, but on dataflow logging and not direct logging.
Basically, I want to turn off the wave of KafkaIO read (consumer) logs. I have tried setting the logging levels in SDK harness as follows.
var kafkasLogs =
SdkHarnessOptions.SdkHarnessLogLevelOverrides.from(
new HashMap<>(
Map.of(
"org.apache.kafka.clients.consumer.internals.SubscriptionState",
SdkHarnessOptions.LogLevel.ERROR.name())));
options.setSdkHarnessLogLevelOverrides(kafkasLogs); // extends sdkharnessoptions
I have also tried variations of the above but have not been successful in my bid to silence the consumer logs.
What is the way I can shut these logs off without messing with the additional logging of my pipeline?
SOLUTION 1: I made it work with org.apache.log4j.Logger
being log4j2.xml:
and build.sbt (I am using SCIO) and I had multiple slfj4 bindings
with "-Dlog4j.configurationFile=src/main/resources/log4j2.xml" and these dependencies should suffice too:
SOLUTION 2:
with JVM -Dlog4j.configurationFile=src/main/resources/log4j2.xml
and
after: after_Configurator_initialize
before: before_Configurator_initialize