Wildfly 负载均衡器日志

Wildfly loadbalancer log

我有一个设置,前面有一个负载均衡器(负载均衡器配置文件中的 wildly-11),back.Now 有两个服务器节点(wildly-11)我需要负载均衡器日志,它可以提供详细信息关于转移到哪个请求 node.Can 谁能解释一下我们如何才能使这些日志出现?

您可以在 WildFly 配置中为 io.undertow.server.handlers.proxy 包指定 DEBUG 日志级别。来自 standalone/configuration/standalone-load-balancer.xml 的示例:

<logger category="io.undertow.server.handlers.proxy">
   <level name="DEBUG"/>
</logger>

之后,您将在日志中看到有关请求代理的信息。 示例:

13:05:06,274 DEBUG [io.undertow.server.handlers.proxy] (default I/O-13) Sending request ClientRequest{path='/xxx-app', method=GET, protocol=HTTP/1.1} to target /127.0.0.1:8009 for exchange HttpServerExchange{ GET /xxx-app request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8], Accept-Language=[en-US,en;q=0.5], Cache-Control=[max-age=0], Accept-Encoding=[gzip, deflate], User-Agent=[...], Connection=[keep-alive], Cookie=[JSESSIONID=B9mIIaGz2QYcPBbODJxvY04wjjRnfSz0r2iYh7VQ.node6], Upgrade-Insecure-Requests=[1], Host=[localhost:8080]} response {}}
13:05:06,274 DEBUG [io.undertow.server.handlers.proxy] (default I/O-13) Sent request ClientRequest{path='/xxx-app', method=GET, protocol=HTTP/1.1} to target 127.0.0.1 for exchange HttpServerExchange{ GET /xxx-app request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8], Accept-Language=[en-US,en;q=0.5], Cache-Control=[max-age=0], Accept-Encoding=[gzip, deflate], User-Agent=[...], Connection=[keep-alive], Cookie=[JSESSIONID=B9mIIaGz2QYcPBbODJxvY04wjjRnfSz0r2iYh7VQ.node6], Upgrade-Insecure-Requests=[1], Host=[localhost:8080]} response {}}
13:05:06,452 DEBUG [io.undertow.server.handlers.proxy] (default I/O-13) Received response ClientResponse{responseHeaders={X-Powered-By=[JSF/1.2], Content-Type=[text/html;charset=UTF-8], Date=[Wed, 13 Nov 2019 10:05:06 GMT]}, responseCode=200, status='OK', protocol=HTTP/1.1} for request ClientRequest{path='/xxx-app', method=GET, protocol=HTTP/1.1} for exchange HttpServerExchange{ GET /xxx-app request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8], Accept-Language=[en-US,en;q=0.5], Cache-Control=[max-age=0], Accept-Encoding=[gzip, deflate], User-Agent=[...], Connection=[keep-alive], Cookie=[JSESSIONID=B9mIIaGz2QYcPBbODJxvY04wjjRnfSz0r2iYh7VQ.node6], Upgrade-Insecure-Requests=[1], Host=[localhost:8080]} response {}}