add log to REST methods in WCF
is there a smart and efficient way to add logs to all REST method approache开发者_如何转开发s. for now I’m using Nlog to a file log, but it's seems not so good to add log to each new method I’m adding to the WCF service
You could write a custom message inspector. In this case you could write a IDispatchMessageInspector for the server side.
Could you not just hook onto the Application_BegingRequest and Application_EndRequest in the global.asax file?
This method works well for me, but it depends on what level of logging you wish to achieve.
Simple and effective.
精彩评论