Wildfly负载平衡器日志

问题描述 投票:1回答:1

我有一个设置,该设置的前面有一个负载均衡器(负载均衡器配置文件中的wildly-11),后面有两个服务器节点(wildly-11)。现在我需要负载均衡器日志,该日志可以提供有关将请求转移到哪个负载均衡器的详细信息节点。谁能解释一下如何使这些日志显示出来?

java wildfly load-balancing undertow wildfly-11
1个回答
0
投票

您可以为io.undertow.server.handlers.proxy包指定DEBUG日志级别。

<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 {}}
© www.soinside.com 2019 - 2024. All rights reserved.