简体   繁体   中英

Log4Net - Logging Server IP for Windows Load Balancing

We are currently using hardware load balancing and are going to be switching to software (Windows Server 2008). In the test run, the servers that are using software load balancing are reporting the load balancing IP and not the server IP to Log4Net.

This is how we are setting the server IP in Log4Net:

HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]

What do I need to change this to in order to log the server IP and NOT the load balancer IP?

Thanks!!!

Take a look at this Post. How to get the IP address of the server on which my C# application is running on?

Is not as simple as one would think because a server can have multiple IP Addresses.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM