I want to prepare myself for future bug tracking and therefore would like to implement some sort of logging. But from here all the trouble starts. What should i log? The more i do the more dirty code and performance hit i get. Personally i hate seeing log
statements in the middle of the code.
In respect to logging, should i log all the web api request as described in http://weblogs.asp.net/pglavich/archive/2012/02/26/asp-net-web-api-request-response-usage-logging.aspx or should i only log the bug reported areas by the customers?
Just to let you know, i am thinking of use Log4Net.
GauravGoyal
Member
3 Points
9 Posts
What information should be logged?
Nov 13, 2012 10:37 PM|LINK
Hi Dear,
I am writing a 3 layered architecture as follows
1. Rest
2 Business Layer
3 Data Layer
I want to prepare myself for future bug tracking and therefore would like to implement some sort of logging. But from here all the trouble starts. What should i log? The more i do the more dirty code and performance hit i get. Personally i hate seeing log statements in the middle of the code.
In respect to logging, should i log all the web api request as described in http://weblogs.asp.net/pglavich/archive/2012/02/26/asp-net-web-api-request-response-usage-logging.aspx or should i only log the bug reported areas by the customers?
Just to let you know, i am thinking of use Log4Net.
Thanks in advance
ignatandrei
All-Star
134903 Points
21619 Posts
Moderator
MVP
Re: What information should be logged?
Nov 13, 2012 11:53 PM|LINK
I would do logging in the first layer the stack trace , when error. That will be enough for the start.
BrockAllen
All-Star
27518 Points
4898 Posts
MVP
Re: What information should be logged?
Nov 14, 2012 12:55 AM|LINK
And make sure you don't log sensitive data (such as passwords, credit card numbers, etc).
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Shailendra S...
Member
551 Points
145 Posts
Re: What information should be logged?
Nov 14, 2012 03:22 AM|LINK
you should log error no error description and the event from where it is triggered.
www.techaray.com
GauravGoyal
Member
3 Points
9 Posts
Re: What information should be logged?
Nov 14, 2012 07:17 AM|LINK
The perfect solution
http://weblogs.asp.net/fredriknormen/archive/2012/06/11/asp-net-web-api-exception-handling.aspx