Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ${aspnet-request-ip}
- public IActionResult AnAction()
- {
- NLog.GlobalDiagnosticsContext.Set("IpAddress", HttpContext.Connection.RemoteIpAddress);
- _logger.LogInformation("Something happened");
- return View();
- }
- <target xsi:type="File" name="allfile" fileName="c:nlog.log"
- layout="${longdate} | ${message} | ${gdc:item=IpAddress}" />
Add Comment
Please, Sign In to add comment