我们目前正在使用硬件负载均衡,并将切换到软件(Windows Server 2008)。在测试运行中,使用软件负载平衡的服务器将向Log4Net报告负载平衡IP,而不是服务器IP。
下面是我们在Log4Net中设置服务器IP的方式:
HttpContext.Current.Request.ServerVariables"LOCAL_ADDR“
为了记录服务器IP而不是负载均衡器IP,我需要将其更改为什么?
谢谢!
发布于 2012-10-11 22:09:30
看看这篇文章。How to get the IP address of the server on which my C# application is running on?
并不像人们想象的那么简单,因为一台服务器可以有多个IP地址。
https://stackoverflow.com/questions/12841425
复制相似问题