[
https://issues.apache.org/jira/browse/CURATOR-369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15774937#comment-15774937
]
ASF GitHub Bot commented on CURATOR-369:
----------------------------------------
Github user Randgalt commented on a diff in the pull request:
https://github.com/apache/curator/pull/179#discussion_r93817403
--- Diff:
curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java
---
@@ -179,13 +179,16 @@ public static String
configToConnectionString(QuorumVerifier data) throws Except
private void processConfigData(byte[] data) throws Exception
{
- log.info("New config event received: " + Arrays.toString(data));
-
Properties properties = new Properties();
properties.load(new ByteArrayInputStream(data));
QuorumMaj newConfig = new QuorumMaj(properties);
currentConfig.set(newConfig);
+ if ( log.isInfoEnabled() )
--- End diff --
Instead of this check you can do:
```java
log.info("New config event received: {}", properties.toString());
```
or
```java
log.info(String.format("New config event received: %s",
properties.toString()));
```
> Improve log format in EnsembleTracker.processConfigData()
> ---------------------------------------------------------
>
> Key: CURATOR-369
> URL: https://issues.apache.org/jira/browse/CURATOR-369
> Project: Apache Curator
> Issue Type: Bug
> Components: Framework
> Affects Versions: 3.2.1
> Reporter: Sylvain Wallez
> Priority: Minor
>
> EnsembleFrameworkTracker has a [log
> statement|https://github.com/apache/curator/blob/CURATOR-3.0/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java#L182]
> that doesn't format its value correctly and is adding noise in log files.
> Sample output of this statement is as follows:
> {noformat}
> [2016-12-09 12:16:26,046][INFO
> ][org.apache.curator.framework.imps.EnsembleTracker][] New config event
> received: [115, 101, 114, 118, 101, 114, 46, 49, 48, 61, 108, 111, 99, 97,
> 108, 104, 111, 115, 116, 58, 50, 56, 57, 56, 58, 51, 56, 57, 56, 58, 112, 97,
> 114, 116, 105, 99, 105, 112, 97, 110, 116, 59, 48, 46, 48, 46, 48, 46, 48,
> 58, 50, 49, 57, 49, 10, 118, 101, 114, 115, 105, 111, 110, 61, 49, 48, 48,
> 48, 48, 48, 48, 48, 48]
> {noformat}
> I'd like to provide a fix for this by logging the properties object once it's
> been parsed, but I'm confused about what branch to patch against. This class
> exists in the CURATOR-3.0 branch, but not in master.
> Is creating a PR against the CURATOR-3.0 branch the way to go?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)