Friday, January 13, 2012

How to assign unique id to WCF with NLog

I want to add a unique id for each session request in WCF using NLog so I can identify to what session
I have not found a clear way to do this but here is a few pointers:



  • How to do this using log4net: http://www.catchblock.com/blog/post/2011/12/02/WCF-Web-API-and-logging-unique-request-id-with-log4net.aspx
  • Further discussion about log4net: http://wcf.codeplex.com/discussions/281421
  • NLog's way of adding context: http://nlog-project.org/wiki/Event-context_layout_renderer

No comments: