-
Notifications
You must be signed in to change notification settings - Fork 1.4k
AspNet Request IP Layout Renderer
Rolf Kristensen edited this page Feb 17, 2023
·
7 revisions
Render Client IP address
Platforms Supported: All
Introduced in NLog Web.AspNetCore 4.4.0 & NLog.Web 4.5.0
${aspnet-request-ip}
-
CheckForwardedForHeader - Should check value of X-Forwarded-For header (Default = false)
Introduced with NLog Web.AspNetCore 4.7.1 & NLog.Web 4.7.1
-
CheckForwardedForHeaderOffset - Should check value of X-Forwarded-For header and specify index-offset from comma-separated-split-array (Default = 0)
Introduced with NLog Web.AspNetCore 5.2.2
- AspNetCore - Uses underlying connection for this request. See HttpContext.Connection.RemoteIpAddress
- AspNet - Returns the
REMOTE_ADDR
-ServerVariables
See also AspNetRequest Host Layout Renderer
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json