gpt4 book ai didi

java - Wildfly 负载均衡器日志

转载 作者:行者123 更新时间:2023-11-30 01:44:04 27 4
gpt4 key购买 nike

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

最佳答案

您可以在 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 {}}

关于java - Wildfly 负载均衡器日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58832873/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com