Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I wanted to Log the things (any error or successful operation in asp.net), so which is the best approach for doing this.

I know one method which is file handling.

Thanks
Posted

1) For logging un handled exceptions (red screens) you can use a logging facility such as ELMAH or NLog. I would recommend ELMAH as it is zero effort to install via a Nuget package & provides logging to database, text file, email etc. You also get a front end which you can access to view exception messages.
2) If you want CRUD logging at database level this can be done multiple ways. You can use SQL triggers to log every operation in separate table.
 
Share this answer
 
Comments
GauravThorat 1-Aug-13 2:20am    
Thanks for Information
Get a logging framework, e.g. Log4Net (http://logging.apache.org/log4net/[^]).
Add logging statements to all those functions manually, or add them using Aspect Oriented Programming methods (some Dependency Injection / Inversion of Control containers like Unity (http://unity.codeplex.com/[^]) offer "interception" which allows for adding extra functionality when a function / property is called).
 
Share this answer
 
Comments
GauravThorat 1-Aug-13 3:13am    
Is it Free or Paid solution, and is there any link there I can check for sample code or syntax for using it in to ASP.NET / ASP.NET MVC4
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900