Skip to content
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

Fix logging a RoutingNode object, log an object with a good .toString instead #9863

Merged
merged 1 commit into from Feb 25, 2015

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Feb 24, 2015

Previously this would log:

[2015-02-24 11:13:45,105][TRACE][cluster.routing.allocation.allocator] [Poltergeist] Try moving shard [[test][2], node[HFn4dJ7fQAyfSAB8BquaSQ], [R], s[STARTED]] from [org.elasticsearch.cluster.routing.RoutingNode@6df2c498]

DiscoveryNode has an actual toString() implementation, so log it instead

@dadoonet
Copy link
Member

LGTM. If needed, may be a fix in 1.4 as well?

@dadoonet dadoonet removed the review label Feb 25, 2015
@bleskes
Copy link
Contributor

bleskes commented Feb 25, 2015

change looks good but why not add a toString to RoutingNode instead? This way we'll also fix future issues and have easier debugging life. How about routingNode ([node_t0][xE3t3-VbSmeeCFRgtNGYeg][Boazs-Air.local][local[1]], [5] assigned shards)

@dakrone
Copy link
Member Author

dakrone commented Feb 25, 2015

@bleskes yeah, that's a better idea, I will do that

@dakrone
Copy link
Member Author

dakrone commented Feb 25, 2015

@bleskes I changed this, it looks much better now:

[2015-02-25 11:32:45,182][TRACE][cluster.routing.allocation.allocator] [Solarr] Try moving shard [[my_index][2], node[HDhbU4D9Rx27MSr_72bmWQ], [P], s[STARTED]] from [routingNode ([Solarr][HDhbU4D9Rx27MSr_72bmWQ][Xanadu.domain][192.168.0.4], [5 assigned shards)]

@bleskes
Copy link
Contributor

bleskes commented Feb 25, 2015

+1 except for a minor parentheses issue: [5 assigned shards)] should probably be [5] assigned shards)]

@dakrone dakrone force-pushed the fix-bsa-log branch 2 times, most recently from e516ae0 to 58cac3d Compare February 25, 2015 21:04
Previously this would log:

```
[2015-02-24 11:13:45,105][TRACE][cluster.routing.allocation.allocator] [Poltergeist] Try moving shard [[test][2], node[HFn4dJ7fQAyfSAB8BquaSQ], [R], s[STARTED]] from [org.elasticsearch.cluster.routing.RoutingNode@6df2c498]
```

Now it will log:

```
[2015-02-25 11:32:45,182][TRACE][cluster.routing.allocation.allocator] [Solarr] Try moving shard [[my_index][2], node[HDhbU4D9Rx27MSr_72bmWQ], [P], s[STARTED]] from [routingNode ([Solarr][HDhbU4D9Rx27MSr_72bmWQ][Xanadu.domain][192.168.0.4], [5 assigned shards])]
```
@dakrone dakrone merged commit 58cac3d into elastic:master Feb 25, 2015
@clintongormley clintongormley added >enhancement :Core/Infra/Logging Log management and logging utilities labels Mar 19, 2015
@dakrone dakrone deleted the fix-bsa-log branch April 6, 2015 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants