elmah

ELMAH and API controller in MVC4 not logging errors

Deadly 提交于 2019-12-03 02:27:58
Using an API controller in MVC4, when the controller action throws an exception, ELMAH does not log the error. I think the problem is that MVC4 sets the HTTP status code to 500, and it returns the exception details in a JSON object, but it does not throw an unhandled exception so ELMAH never sees it. How can I get ELMAH to capture all responses where the status code is not 200? The anwser described before doesn't work. I've tried on my test server and received an error ("The given filter instance must implement one or more of the following filter interfaces: IAuthorizationFilter, IActionFilter

Elmah error logging, can I just log a message?

半腔热情 提交于 2019-12-02 23:46:46
I just installed Elmah ( https://code.google.com/p/elmah/ ) for my ASP.NET application. Is it possible to log a message without creating an Exception first? catch(Exception e) { Exception ex = new Exception("ID = 1", e); ErrorSignal.FromCurrentContext().Raise(ex); } So is it possible to do: ErrorSignal.FromCurrentContext().log("Hello I am testing Elmah"); Yes, you can use ErrorSignal without throwing an exception. ErrorSignal.FromCurrentContext().Raise(new NotSupportedException()); For the custom message, you can create a custom exception. var customEx = new Exception("Hello I am testing Elmah

Limiting the Number of Emails Sent By Elmah

陌路散爱 提交于 2019-12-02 23:39:44
Does anyone know of a good way to limit the number of emails sent by Elmah during a time period like you can with Health Monitoring? I want to be able to limit the emails for each error from each page to only an email once an hour or so for that particular error and page. Looking at the elmah documentation it looks like using: void ErrorMail_Filtering(object sender, ExceptionFilterEventArgs e) { // perform filtering here } in the global.ascx file might be an option. I could setup a static object per application that contains some the error details and the time logged and check it and cancel

How to get Elmah working with ASP.NET and IIS 5.1 URL Routing

眉间皱痕 提交于 2019-12-02 23:13:51
I am having issues with regards to running my ASP.NET MVC application thru my local IIS 5.1 web server. I believe these issues are related to IgnoreRoutes, but I can't seem to craft an IgnoreRoute such that it resolves the problem. Problem: I am able to view my elmah error page (localhost/mvcapplication1/elmah.axd), however, the CSS is missing and none of the links work. Steps to Reproduce 1) Create an ASP.NET MVC 1.0 Application 2) Add Elmah. Download the assemblies, add them to your project and use the steps from Elmah Setup Instructions 3) Switch your application to 'Use Local IIS Web

Separate viewer application for ELMAH's log

谁说我不能喝 提交于 2019-12-02 20:54:07
We're using ELMAH for error logging in our ASP.NET application. We use the SQL Server error logging. Because of security and configuration constraints in the application, we would like to have the log viewer UI (Elmah.ErrorLogPageFactory) in a separate web application, connected to the same database. However, ELMAH filters errors on application name, so just deploying a separate application, you also get a separate log. Is there a way to configure ELMAH to work as a standalone log viewer, i.e. display the log messages from a different application? You can override the application name in the

MVC ELMAH and SQL Azure

妖精的绣舞 提交于 2019-12-02 18:33:57
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 key differences right away namely on not supporting: ON [PRIMARY], NONCLUSTERED KEYS, etc. I migrated

Where does ELMAH save its data?

懵懂的女人 提交于 2019-12-02 17:53:14
I just installed ELMAH.MVC (more info here ) and was wondering where its data is saved. I read that you can choose to set up database for storage but seems that the default install uses "in memory"? How does it work? If I recycle the app pool or IIS website do I loose all the data? Thanks! Aleksandar Vucetic Yes, by default it uses memory storage. When your application pool is restarted, you loose elmah data. If I remember well, old versions of elmah used App_Data folder for storing xml files...If you want to use database to store logs, just specify connection string in your elmah config

ELMAH exceptions generating generic “The service is unavailable” message

半腔热情 提交于 2019-12-02 06:27:41
问题 I'm trying to create an availability page which checks all the services that a site uses, wrapping each check in a try/catch and then displaying any failures to the users. One of those services is ELMAH, so I am calling that to double check that we can log errors there successfully. Controller: var a = new AvailabilityModel(); try { a.ElmahConnectionString = ConfigurationManager.ConnectionStrings["elmah-sqlserver"].ConnectionString; Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(

ELMAH exceptions generating generic “The service is unavailable” message

梦想与她 提交于 2019-12-01 23:10:01
I'm trying to create an availability page which checks all the services that a site uses, wrapping each check in a try/catch and then displaying any failures to the users. One of those services is ELMAH, so I am calling that to double check that we can log errors there successfully. Controller: var a = new AvailabilityModel(); try { a.ElmahConnectionString = ConfigurationManager.ConnectionStrings["elmah-sqlserver"].ConnectionString; Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception("Elmah availability test")); a.ElmahSuccess = true; } catch (Exception ex) { a.ElmahSuccess = false; a

elmah error handling - store in database

狂风中的少年 提交于 2019-12-01 19:19:57
How do I get ELMAH to store the cached errors in my database? Has anyone implemented it already? If yes please guide me how to do that step by steps please? Thank you Here's an article that describes how to configure ELMAH to log to a SQL Server database. http://www.codeproject.com/KB/ThirdParty/ErrorloggingUsingElmah.aspx 来源: https://stackoverflow.com/questions/6596736/elmah-error-handling-store-in-database