diff --git a/README.md b/README.md index 91688f9d..6dd05694 100644 --- a/README.md +++ b/README.md @@ -125,8 +125,6 @@ The following configuration options are available: - `--volatile-group-instance-id`: Whether the group instance id is volatile, i.e., it will change on a Streams shutdown. -- `--debug`: Configure logging to debug - Additionally, the following commands are available: - `clean`: Reset the Kafka Streams application. Additionally, delete the consumer group and all output and intermediate @@ -188,8 +186,6 @@ The following configuration options are available: - `--extra-output-topics`: Additional named output topics (`String=String>[,...]`) -- `--debug`: Configure logging to debug - Additionally, the following commands are available: - `clean`: Delete all output topics associated with the Kafka Producer application. diff --git a/charts/producer-app-cleanup-job/templates/job.yaml b/charts/producer-app-cleanup-job/templates/job.yaml index b1c0abec..50a4a4ea 100644 --- a/charts/producer-app-cleanup-job/templates/job.yaml +++ b/charts/producer-app-cleanup-job/templates/job.yaml @@ -72,10 +72,6 @@ spec: - name: "{{ .Values.configurationEnvPrefix }}_SCHEMA_REGISTRY_URL" value: {{ .Values.streams.schemaRegistryUrl | quote }} {{- end }} - {{- if hasKey .Values "debug" }} - - name: "{{ .Values.configurationEnvPrefix }}_DEBUG" - value: {{ .Values.debug | quote }} - {{- end }} {{- if hasKey .Values.streams "outputTopic" }} - name: "{{ .Values.configurationEnvPrefix }}_OUTPUT_TOPIC" value: {{ .Values.streams.outputTopic | quote }} diff --git a/charts/producer-app-cleanup-job/values.yaml b/charts/producer-app-cleanup-job/values.yaml index e0d956f7..10ba2322 100644 --- a/charts/producer-app-cleanup-job/values.yaml +++ b/charts/producer-app-cleanup-job/values.yaml @@ -29,8 +29,6 @@ streams: commandLine: {} # MY_CLI_PARAM: "foo-bar" -debug: false - env: {} # MY_ENV_VARIABLE: foo-bar diff --git a/charts/producer-app/README.md b/charts/producer-app/README.md index ca687af2..d5dd1823 100644 --- a/charts/producer-app/README.md +++ b/charts/producer-app/README.md @@ -60,7 +60,6 @@ Alternatively, a YAML file that specifies the values for the parameters can be p |--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| | `configurationEnvPrefix` | Prefix for environment variables to use that should be parsed as command line arguments. | `APP` | | `commandLine` | Map of command line arguments passed to the producer app. | `{}` | -| `debug` | Configure logging to debug | `false` | | `env` | Custom environment variables | `{}` | | `secrets` | Custom secret environment variables. Prefix with `configurationEnvPrefix` in order to pass secrets to command line or prefix with `KAFKA_` to pass secrets to Kafka Streams configuration. E.g., `APP_MY_PARAM` would be passed as `--my-param` and `KAFKA_MAX_POLL_TIMEOUT_MS` would be translated to `max.poll.timeout.ms`. | `{}` | | `secretRefs` | Inject existing secrets as environment variables. Map key is used as environment variable name. Value consists of secret `name` and `key`. | `{}` | diff --git a/charts/producer-app/templates/pod.yaml b/charts/producer-app/templates/pod.yaml index acd82f00..50bc96e6 100644 --- a/charts/producer-app/templates/pod.yaml +++ b/charts/producer-app/templates/pod.yaml @@ -56,10 +56,6 @@ spec: - name: "{{ .Values.configurationEnvPrefix }}_SCHEMA_REGISTRY_URL" value: {{ .Values.streams.schemaRegistryUrl | quote }} {{- end }} - {{- if hasKey .Values "debug" }} - - name: "{{ .Values.configurationEnvPrefix }}_DEBUG" - value: {{ .Values.debug | quote }} - {{- end }} {{- if hasKey .Values.streams "outputTopic" }} - name: "{{ .Values.configurationEnvPrefix }}_OUTPUT_TOPIC" value: {{ .Values.streams.outputTopic | quote }} diff --git a/charts/producer-app/values.yaml b/charts/producer-app/values.yaml index 4f7480ab..d09628ad 100644 --- a/charts/producer-app/values.yaml +++ b/charts/producer-app/values.yaml @@ -62,8 +62,6 @@ streams: commandLine: {} # MY_CLI_PARAM: "foo-bar" -debug: false - env: {} # MY_ENV_VARIABLE: foo-bar diff --git a/charts/streams-app-cleanup-job/templates/job.yaml b/charts/streams-app-cleanup-job/templates/job.yaml index 7d97fa6b..931f2821 100644 --- a/charts/streams-app-cleanup-job/templates/job.yaml +++ b/charts/streams-app-cleanup-job/templates/job.yaml @@ -76,10 +76,6 @@ spec: - name: "{{ .Values.configurationEnvPrefix }}_SCHEMA_REGISTRY_URL" value: {{ .Values.streams.schemaRegistryUrl | quote }} {{- end }} - {{- if hasKey .Values "debug" }} - - name: "{{ .Values.configurationEnvPrefix }}_DEBUG" - value: {{ .Values.debug | quote }} - {{- end }} {{- if and (hasKey .Values.streams "inputTopics") (.Values.streams.inputTopics) }} - name: "{{ .Values.configurationEnvPrefix }}_INPUT_TOPICS" value: {{ .Values.streams.inputTopics | join "," | quote }} diff --git a/charts/streams-app-cleanup-job/values.yaml b/charts/streams-app-cleanup-job/values.yaml index b3464e2a..029bb730 100644 --- a/charts/streams-app-cleanup-job/values.yaml +++ b/charts/streams-app-cleanup-job/values.yaml @@ -41,8 +41,6 @@ streams: commandLine: {} # MY_CLI_PARAM: "foo-bar" -debug: false - env: {} # MY_ENV_VARIABLE: foo-bar # diff --git a/charts/streams-app/README.md b/charts/streams-app/README.md index 44db5cfc..5fcc3b47 100644 --- a/charts/streams-app/README.md +++ b/charts/streams-app/README.md @@ -71,7 +71,6 @@ Alternatively, a YAML file that specifies the values for the parameters can be p |--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| | `configurationEnvPrefix` | Prefix for environment variables to use that should be parsed as command line arguments. | `APP` | | `commandLine` | Map of command line arguments passed to the streams app. | `{}` | -| `debug` | Configure logging to debug | `false` | | `env` | Custom environment variables | `{}` | | `secrets` | Custom secret environment variables. Prefix with `configurationEnvPrefix` in order to pass secrets to command line or prefix with `KAFKA_` to pass secrets to Kafka Streams configuration. E.g., `APP_MY_PARAM` would be passed as `--my-param` and `KAFKA_MAX_POLL_TIMEOUT_MS` would be translated to `max.poll.timeout.ms`. | `{}` | | `secretRefs` | Inject existing secrets as environment variables. Map key is used as environment variable name. Value consists of secret `name` and `key`. | `{}` | diff --git a/charts/streams-app/templates/deployment.yaml b/charts/streams-app/templates/deployment.yaml index fbec1575..2c061ca2 100644 --- a/charts/streams-app/templates/deployment.yaml +++ b/charts/streams-app/templates/deployment.yaml @@ -123,10 +123,6 @@ spec: - name: "{{ .Values.configurationEnvPrefix }}_SCHEMA_REGISTRY_URL" value: {{ .Values.streams.schemaRegistryUrl | quote }} {{- end }} - {{- if hasKey .Values "debug" }} - - name: "{{ .Values.configurationEnvPrefix }}_DEBUG" - value: {{ .Values.debug | quote }} - {{- end }} {{- if and (hasKey .Values.streams "inputTopics") (.Values.streams.inputTopics) }} - name: "{{ .Values.configurationEnvPrefix }}_INPUT_TOPICS" value: {{ .Values.streams.inputTopics | join "," | quote }} diff --git a/charts/streams-app/values.yaml b/charts/streams-app/values.yaml index b3627e9d..ee6b8681 100644 --- a/charts/streams-app/values.yaml +++ b/charts/streams-app/values.yaml @@ -49,8 +49,6 @@ streams: commandLine: {} # MY_CLI_PARAM: "foo-bar" -debug: false - env: {} # MY_ENV_VARIABLE: foo-bar diff --git a/streams-bootstrap-cli/build.gradle.kts b/streams-bootstrap-cli/build.gradle.kts index da3fc86c..15548118 100644 --- a/streams-bootstrap-cli/build.gradle.kts +++ b/streams-bootstrap-cli/build.gradle.kts @@ -7,9 +7,6 @@ plugins { dependencies { api(project(":streams-bootstrap-core")) api(group = "info.picocli", name = "picocli", version = "4.7.5") - val log4jVersion: String by project - implementation(group = "org.apache.logging.log4j", name = "log4j-core", version = log4jVersion) - implementation(group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version = log4jVersion) val junitVersion: String by project testRuntimeOnly(group = "org.junit.jupiter", name = "junit-jupiter-engine", version = junitVersion) @@ -31,4 +28,6 @@ dependencies { name = "schema-registry-mock-junit5", version = fluentKafkaVersion ) + val log4jVersion: String by project + testImplementation(group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version = log4jVersion) } diff --git a/streams-bootstrap-cli/src/main/java/com/bakdata/kafka/KafkaApplication.java b/streams-bootstrap-cli/src/main/java/com/bakdata/kafka/KafkaApplication.java index 22758b3c..0a00d3c1 100644 --- a/streams-bootstrap-cli/src/main/java/com/bakdata/kafka/KafkaApplication.java +++ b/streams-bootstrap-cli/src/main/java/com/bakdata/kafka/KafkaApplication.java @@ -42,8 +42,6 @@ import lombok.Setter; import lombok.ToString; import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.core.config.Configurator; import picocli.CommandLine; import picocli.CommandLine.Command; import picocli.CommandLine.ParseResult; @@ -56,7 +54,6 @@ *
  • {@link #outputTopic}
  • *
  • {@link #extraOutputTopics}
  • *
  • {@link #brokers}
  • - *
  • {@link #debug}
  • *
  • {@link #schemaRegistryUrl}
  • *
  • {@link #kafkaConfig}
  • * @@ -92,8 +89,6 @@ public abstract class KafkaApplication extraOutputTopics = emptyMap(); @CommandLine.Option(names = "--brokers", required = true, description = "Broker addresses to connect to") private String brokers; - @CommandLine.Option(names = "--debug", arity = "0..1", description = "Configure logging to debug") - private boolean debug; @CommandLine.Option(names = "--schema-registry-url", description = "URL of Schema Registry") private String schemaRegistryUrl; @CommandLine.Option(names = "--kafka-config", split = ",", description = "Additional Kafka properties") @@ -299,20 +294,16 @@ public final CleanableApp createCleanableApp() { protected abstract CA createConfiguredApp(final A app, AppConfiguration configuration); /** - * Configure application when running in debug mode. By default, Log4j2 log level is configured to debug for - * {@code com.bakdata} and the applications package. + * Called before starting the application, e.g., invoking {@link #run()} */ - protected void configureDebug() { - Configurator.setLevel("com.bakdata", Level.DEBUG); - Configurator.setLevel(this.getClass().getPackageName(), Level.DEBUG); + protected void onApplicationStart() { + // do nothing by default } private void startApplication() { Runtime.getRuntime().addShutdownHook(new Thread(this::close)); + this.onApplicationStart(); log.info("Starting application"); - if (this.debug) { - this.configureDebug(); - } log.debug("Starting application: {}", this); }