I am using NLog for logging. I need to log the IP address of the user who is opening the website.
For that purposes, I am using the aspnet-request-ip property of NLog. The documentation is here: https://github.com/NLog/NLog/wiki/AspNet-Request-IP-Layout-Renderer
My layout in NLog config looks like the following right now:
layout='"${longdate:universalTime=true}","${level}",${aspnet-request-ip},"${message}"'
The problem is - that the logged IP address is the IP of the machine which is hosting the website. But I need the IP of the user who is opening/requesting the website. I need to log from which IP the website is requested/opened.
How can I do this? Or why aspnet-request-ip is logging the host IP address, instead of the user/client IP address?