Once one has a logging and tracing setup using log4net in place for ASP.NET Web API, what are the specific aspects that need to be logged and/or traced?
I am asking this specifically from Web API perspective. Is there a series of MUST Log this or MUST trace this. Like, INFO traces about a controller's request, any NULL checks, etc.
Is there a reference list that can be validated against to ensure optimum logging and tracing coverage in ASP.NET Web API ?
So I will assume your goal for the logging is, as it should be, to debug the application rather than measure for performance.
While I think there is no one 'right' answer to this, at the minimum I would always try to log
I'm sure there is more missing from this list - after all this varies on what yr doing in the app. You should be asking yourself at every step of the way - what could go wrong in my application? What things would I or the poor chap that will work on this after me find useful whilst debugging a problem?
If you are hosting your webapi in IIS, you can enable IIS LOG and counters:
http://www.iis.net/configreference/system.applicationhost/sites/site/logfile
Performance Counters:
http://msdn.microsoft.com/en-us/library/fxk122b4%28v=VS.100%29.aspx
http://www.iis.net/learn/extensions/configuring-application-request-routing-(arr)/using-performance-counters
An additional category of items to log for a service code that implements authorization authentication and impersonation where elevated access is required. These should be configurable to log either success failure or both.