Log snippet instead of entire config
@@ -10,6 +10,7 @@ import com.yahoo.config.subscription.DirSource;
import com.yahoo.config.subscription.FileSource;
import com.yahoo.config.subscription.JarSource;
import com.yahoo.config.subscription.RawSource;
+import com.yahoo.text.SnippetGenerator;
import com.yahoo.vespa.config.ConfigKey;
import com.yahoo.vespa.config.PayloadChecksums;
import com.yahoo.vespa.config.TimingValues;
@@ -201,8 +202,11 @@ public abstract class ConfigSubscription<T extends ConfigInstance> {
ConfigState<T> prev = this.config.get();
boolean configChanged = !Objects.equals(prev.getConfig(), config);
if (configChanged) {
+ SnippetGenerator generator = new SnippetGenerator();
+ int sizeHint = 500;
log.log(Level.WARNING, "Config has changed unexpectedly for " + key + ", generation " + generation +
- ", config in state :" + prev.getConfig() + ", new config: " + config);
+ ", config in state :" + generator.makeSnippet(prev.getConfig().toString(), sizeHint) + ", new config: " +
+ generator.makeSnippet(config.toString(), sizeHint));
}
this.config.set(new ConfigState<>(true, generation, applyOnRestart, configChanged, config, payloadChecksums));
}
