-
Notifications
You must be signed in to change notification settings - Fork 15k
MINOR: Log formatting for exceptions during configuration related operations #10843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,7 +295,7 @@ class DynamicBrokerConfig(private val kafkaConfig: KafkaConfig) extends Logging | |
| dynamicBrokerConfigs ++= props.asScala | ||
| updateCurrentConfig() | ||
| } catch { | ||
| case e: Exception => error(s"Per-broker configs of $brokerId could not be applied: $persistentProps", e) | ||
| case e: Exception => error(s"Per-broker configs of $brokerId could not be applied: ${persistentProps.keys()}", e) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -306,7 +306,7 @@ class DynamicBrokerConfig(private val kafkaConfig: KafkaConfig) extends Logging | |
| dynamicDefaultConfigs ++= props.asScala | ||
| updateCurrentConfig() | ||
| } catch { | ||
| case e: Exception => error(s"Cluster default configs could not be applied: $persistentProps", e) | ||
| case e: Exception => error(s"Cluster default configs could not be applied: ${persistentProps.keys()}", e) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -469,7 +469,7 @@ class DynamicBrokerConfig(private val kafkaConfig: KafkaConfig) extends Logging | |
| } | ||
| invalidProps.keys.foreach(props.remove) | ||
| val configSource = if (perBrokerConfig) "broker" else "default cluster" | ||
| error(s"Dynamic $configSource config contains invalid values: $invalidProps, these configs will be ignored", e) | ||
| error(s"Dynamic $configSource config contains invalid values in: ${invalidProps.keys}, these configs will be ignored", e) | ||
|
||
| } | ||
| } | ||
|
|
||
|
|
@@ -555,7 +555,8 @@ class DynamicBrokerConfig(private val kafkaConfig: KafkaConfig) extends Logging | |
| } catch { | ||
| case e: Exception => | ||
| if (!validateOnly) | ||
| error(s"Failed to update broker configuration with configs : ${newConfig.originalsFromThisConfig}", e) | ||
| error(s"Failed to update broker configuration with configs : " + | ||
| s"${ConfigUtils.configMapToRedactedString(newConfig.originalsFromThisConfig, KafkaConfig.configDef)}", e) | ||
| throw new ConfigException("Invalid dynamic configuration", e) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix!