Skip to content

Instantly share code, notes, and snippets.

@alistairjevans
Created September 7, 2019 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alistairjevans/0b0664bae2a13a350964a48c78f2c9b7 to your computer and use it in GitHub Desktop.
Save alistairjevans/0b0664bae2a13a350964a48c78f2c9b7 to your computer and use it in GitHub Desktop.
Added username
<!-- the targets to write to -->
<targets>
<!-- write logs to file -->
<target xsi:type="File" name="allfile" fileName="c:\temp\nlog-all-${shortdate}.log"
layout="${longdate} | ${uppercase:${level:padding=5}} | ${mdlc:userName} | ${logger} | ${message} ${exception:format=tostring}" />
<!-- another file log, only own logs. Uses some ASP.NET core renderers -->
<target xsi:type="File" name="ownFile-web" fileName="c:\temp\nlog-own-${shortdate}.log"
layout="${longdate} | ${uppercase:${level:padding=5}} | ${mdlc:userName} | ${logger} | ${message} ${exception:format=tostring} | url: ${aspnet-request-url} | action: ${aspnet-mvc-action}" />
</targets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment