如何通过zuul捕获微服务的每个实例上的日志 [英] How to capture log on each instance of the microservice through zuul

查看:568
本文介绍了如何通过zuul捕获微服务的每个实例上的日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了多个微服务实例,并已注册到我的eureka服务器.它使用功能区进行客户端负载平衡,并使用zuul作为网关服务器.所有普通的东西.我想捕获我的服务实例响应每个请求的日志.这样我就可以根据每个实例的使用情况得出一些结论.该怎么做?

I have setup multiple instances of my microservice and registered to my eureka server. It uses ribbon for client side load balancing and uses zuul as gateway server. All usual stuff. I would like to capture the logs of which instance of my service is responding for each request. So that I can able to bring some conclusion based on my usage of each instances. How to do that?

推荐答案

您可以尝试仅设置LoadBalancerContext的日志级别以在application.properties中调试

You can try to set the loglevel just of the LoadBalancerContext to debug in application.properties

#logging
logging.level.com.netflix.loadbalancer.LoadBalancerContext=DEBUG

这篇关于如何通过zuul捕获微服务的每个实例上的日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆