Click here to Skip to main content
15,909,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want create log while exception occurs in catch and save it into text file which will create in folder..
Posted

1 solution

You have all explanations and also source code in my next article: MVC Basic Site: Step 2 - Exceptions Management[^]
 
Share this answer
 
Comments
Member 9579525 3-Mar-14 6:39am    
thanks..it works..but can we save data in log file in asceding date wise..means last error dislply first and so on..
Raul Iloc 3-Mar-14 6:42am    
The Windows EventLog let you filter and sort the notifications as you want!
Member 9579525 3-Mar-14 7:00am    
ok thanx..i also want to diaply error message on popup ehich is save in log file how can we do that?
Raul Iloc 3-Mar-14 7:03am    
http://social.msdn.microsoft.com/Forums/en-US/5bdd8518-5509-4414-a6a3-aa2e31c1bcc1/reading-event-logs-in-c-increasing-performance?forum=csharplanguage
Member 9579525 3-Mar-14 7:30am    
after saving log file i want ridirect to custom view calld "Error.cshtml" i tried this
filterContext.HttpContext.Response.Redirect("~/Shared/Error", true);
or
filterContext.Result =this.RedirectToAction("Logout", "Home");
but both doesnt work..

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



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