user2455862
user2455862

Reputation: 678

Is it possible for Netflix Ribbon to show log which server was chosen

I'm creating a microservices system and I have Zuul server where I use Ribbon which connects to Eureka(which returns me the available service instances) and perform load-balancing. Everything works great, however I would like to see in the logs which particular instance was chosen by Ribbon. I know that I can add some extra logging to the instances but I want to have it in one place. I've read Ribbon documentation and I haven't found any information how to do it... I would be very grateful for your help.

Upvotes: 2

Views: 1320

Answers (1)

Vladimir Filippov
Vladimir Filippov

Reputation: 11

Try to add DEBUG logger level:

  1. com.netflix.loadbalancer.LoadBalancerContext

It's printing messages like:

my-service using LB returned Server: host:port for request http:request-url
  1. com.netflix.loadbalancer.reactive.LoadBalancerCommand printing:
Got error java.net.ConnectException: Connection refused (Connection refused) when executed on server host:port
  1. all 'com.netflix' also can help

For example my logback.groovy has a line:

logger('com.netflix', DEBUG)

Upvotes: 1

Related Questions