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

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

This comment has been minimized.

Copy link
Member

commented Feb 25, 2015

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

@dadoonet dadoonet removed the review label Feb 25, 2015

@bleskes

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

commented Feb 25, 2015

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

@dakrone

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Member

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 dakrone:fix-bsa-log branch 2 times, most recently to 58cac3d Feb 25, 2015

Add a .toString() method to RoutingNode
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

1 check passed

CLA Commit author has signed the CLA
Details

@dakrone dakrone deleted the dakrone:fix-bsa-log branch Apr 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.