Guest User

Untitled

a guest
Nov 20th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. ${aspnet-request-ip}
  2.  
  3. public IActionResult AnAction()
  4. {
  5. NLog.GlobalDiagnosticsContext.Set("IpAddress", HttpContext.Connection.RemoteIpAddress);
  6. _logger.LogInformation("Something happened");
  7. return View();
  8. }
  9.  
  10. <target xsi:type="File" name="allfile" fileName="c:nlog.log"
  11. layout="${longdate} | ${message} | ${gdc:item=IpAddress}" />
Add Comment
Please, Sign In to add comment