elmah

elmah customized provider and exposed event

限于喜欢 提交于 2019-12-10 09:46:52
问题 I am wondering how do I create my customized provider for storing the error logs, eg. a provider to windows event viewer. If it is not possible so far, I am also wondering is there any exposed events I can override, so that I can inject my code, get the exception, do whatever I want. I know there are some event I can override in Global.asax. like for filtering: void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e) { } void ErrorMail_Filtering(object sender,

HttpContext.Current.Items cleared via responseMode=“ExecuteURL”?

眉间皱痕 提交于 2019-12-10 04:52:49
问题 I avoid the default ASP.NET approach of redirecting on errors (as many people do). Clean AJAX code and SEO are among the reasons. However, I'm using the following method to do it, and it seems that I may lose HttpContext.Current.Items in the transfer? <httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="401" /> <remove statusCode="403" /> <remove statusCode="404" /> <remove statusCode="500" /> <error statusCode="401" responseMode="ExecuteURL" path="/Account/SignIn" /

Debug/Trace messages using ELMAH in MVC application

一曲冷凌霜 提交于 2019-12-10 04:51:42
问题 How do we add debug/Trace messages using ELMAH in MVC application 回答1: ELMAH is usually used to report exceptions and not as a general Debug/Trace log. For Debug/Trace logging I would suggest a combination of log4net and Log4PostSharp. 回答2: Elmah will catch unhandled exceptions automatically. By tracing I think you mean logging exceptions that are handled? If you want to manually log handled exceptions, the process in MVC is the same as for ASP.NET: Add a reference to the Elmah DLL to your

Getting the Id of an error in Elmah after calling .Raise()

拈花ヽ惹草 提交于 2019-12-09 09:59:51
问题 I'm working on an MVC3 application and I'm using Elmah to handle my error logging. What I want in my application is to carry the Elmah Id onto the custom error page as I will provide a link which allows a user to specifically report it in the event that it is a repeat error (in their opinion). Now, I've read similar questions on here and they suggest adding the following code (or similar) to the Global.asax.cs file: void ErrorLog_Logged(object sender, ErrorLoggedEventArgs args) { string

What does the utmscr or utmcct values mean in reference to the Http cookie Server variable?

风格不统一 提交于 2019-12-09 09:49:46
问题 What does the utmscr and/or utmcct values mean in reference to the Http cookie Server variable? Are they acronyms or short for something? We are getting Elmah errors with the title "System.Web.HttpException: Unable to validate data." In each Elmah error message, the Http Cookie server variable value contains a property called utmscr set to the same Web site and utmcct set to a page at that Web site. Here is a section from the Http Cookie Value from the Elmah Server variables dump. utmccn=

Elmah log files deletion, manually or is there a setting?

时间秒杀一切 提交于 2019-12-09 07:56:00
问题 How do I delete the log files that Elmah generates on the server? Is there a setting within Elmah that I can use to delete log files? I would prefer to specify some criteria (e.g. log files that are older than 30 days). Or should I write my own code for that ? 回答1: You can set the maximum number of log entries, but there isn't a native function for clearing out logs older than a given date. It's a good feature request, though! If you are storing your error logs in memory the maximum number

MVC ELMAH and SQL Azure

会有一股神秘感。 提交于 2019-12-09 04:08:20
问题 back-story: We mainly use AWS for everything (hosting, database, notifications, etc.). Now, I'm looking at moving the database side to SQL Azure since we've been getting crazy bills on AWS RDS. So all I tried to do was create a DB in SQL Azure and update the connection string to point to the new DB. In the past, ELMAH (this specific implementation: https://github.com/alexanderbeletsky/elmah.mvc) worked flawlessly in the past. current situation: I just created a new DB in SQL Azure and noticed

Configuring ELMAH: Unrecognized config section error

烂漫一生 提交于 2019-12-09 02:59:42
问题 Setup: Windows XP .NET Framework 3.5 SP1 ASP .NET MVC Version 1 I've been trying to set up ELMAH by following the instructions at http://code.google.com/p/elmah/wiki/MVC but I just get the following error when press F5: Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized configuration section elmah

what part of web.config do i insert the elmah tag?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 19:18:34
问题 I want to write this <elmah> <errorlog type="Elmah.XmlFilerErrorLog, Elmah" logPath="~/App_Data" /> </elmah> or <elmah> <errorLog type="Elmah.SQLiteErrorLog, Elmah" logPath="~/App_Data" /> </elmah> however every place i tried putting this tag in i get an Unrecognized configuration section elmah. error. I found this question Configuring ELMAH: Unrecognized config section error however i tried that (solution at the bottom of the question) and still get the error. Where do i put this? -edit- i

Reading/writing ELMAH log information from/into a custom table

若如初见. 提交于 2019-12-08 08:53:57
问题 I've been experimenting with ELMAH to use it for my new MVC project. Is there any way I can use custom database schema for error logging? Also how I can customize the information displayed in the elmah.axd page? 回答1: I wouldn't attempt to customize the elmah.axd page. I'd just create my own page that queried the data out of the database directly. It's going to be much easier. The source code even includes some samples of this. However, if you want to change the table name or change the names