Questions tagged [elmah]

ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility for ASP.NET that is completely pluggable.

ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.

To learn more about ELMAH, see the MSDN article “Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components” by Scott Mitchell and Atif Aziz.

Installing ELMAH can most easily be done using its NuGet package:

Install-Package elmah
968 questions
13
votes
6 answers

Adding extra information to a custom exception

I've created a custom exception for a very specific problem that can go wrong. I receive data from another system, and I raise the exception if it bombs while trying to parse that data. In my custom exception, I added a field called "ResponseData",…
SuperJason
13
votes
4 answers

Unwanted SQLite inserted in \bin

I am using Visual Studio 2010 and using web deployment to promote the .Net MVC site to specific environments. I installed Elmah, and it worked great on my DEV environment, but when I pushed TEST, I got exceptions because SQLite was not a good…
wilk
  • 987
  • 8
  • 16
13
votes
3 answers

ELMAH is not logging offending code line number

I am using ELMAH's default configuration that was setup by NuGet pacakge manager. However, ELMAH does not provide any information about the line number of the offending code in my project. Instead, it provides stack trace of all the DotNet…
user266909
  • 1,841
  • 3
  • 32
  • 58
13
votes
1 answer

Elmah logging errors in SQL server but not showing up on Elmah.axd

I have Elmah set up on a WCF application and it is logging to SQL server. Everything seems to be working as far as inserting the data into the Elmah_error table. But there are 5 errors in the table and only 2 displayed on Elmah.axd. How can I set…
FarFigNewton
  • 7,108
  • 13
  • 50
  • 77
12
votes
4 answers

ELMAH SQL Error Handler database not available- what happens to logging?

I'm testing ELMAH and have deliberately turned off the database connection for the ELMAH log in my application to see what will happen in production if the DB isn't available. It seems that ELMAH can't trap its own errors- the AXD file isn't…
Caveatrob
  • 12,667
  • 32
  • 107
  • 187
12
votes
1 answer

Elmah did not log HttpRequestValidationException

In my ASP.NET MVC2 application Elmah fails to log any HttpRequestValidationException (except when you are logged into the webserver via remote desktop and browsing the site as localhost) For example if I type ' into a textbox when browsing…
JK.
  • 21,477
  • 35
  • 135
  • 214
12
votes
1 answer

MVC app deployment; System.Data.SqlClient.SqlException: Could not find stored procedure 'ELMAH_GetErrorsXml'

I have deployed my MVC app but the error handling does not work. I use a SQLite database and when I try to navigate to the error messages in Elmah i get this exception; System.Data.SqlClient.SqlException: Could not find stored procedure…
arame3333
  • 9,887
  • 26
  • 122
  • 205
12
votes
5 answers

Using property injection instead of constructor injection

Long story short, I'm trying to use ELMAH with MVC 2 and Ninject, and I need to use parameterless constructors. I created an initial post about it here: Using a parameterless controller constructor with Ninject? I was advised to use property…
Steven
  • 18,761
  • 70
  • 194
  • 296
12
votes
3 answers

How to log unhandled exception in .net core

With ELMAH feature in web api 2.0 and Centralized logging and error handling , runtime calls logging module and decide if it can be handled then calls the handler else just logs it.. how can this feature be added in web api core. as we don't have…
zubin joshi
  • 187
  • 1
  • 1
  • 7
12
votes
2 answers

Elmah add message to error logged through call to Raise(e)

I'm a bit confused at how to add a message to an error logged programatically with ELMAH. eg: public ActionResult DoSomething(int id) { try { ... } catch (Exception e) { // I want to include the 'id' param value here, and maybe…
fearofawhackplanet
  • 52,166
  • 53
  • 160
  • 253
12
votes
1 answer

Serilog, Elmah or both for a ASP.NET MVC project?

I implemented Serilog for a ASP.NET MVC project which will be hosted in Azure and Serilog provides sinks to log to Azure storage. I then wanted a better way to handle exceptions and ran into this very informative article on integrating ASP.NET MVC…
DotnetDude
  • 11,617
  • 35
  • 100
  • 158
12
votes
2 answers

Where is elmah.mvc log file located

After installing elmah.mvc from nuget: where is the log file created by default? Errors are logged just fine when I go to /myapp/elmah however I don't see where the actual log file resides. thanks
ShaneKm
  • 20,823
  • 43
  • 167
  • 296
12
votes
3 answers

Elmah doesn't log exceptions using WebAPI with HttpResponseException

In my WebApi code, I raise a HttpResponseException which short-circuits the request pipeline and generates a valid Http response. However, I'm trying to integrate webApi with elmah logging, yet the HttpResponseExeptions aren't showing up. I have the…
jaffa
  • 26,770
  • 50
  • 178
  • 289
12
votes
2 answers

Error pages not found, throwing ELMAH error with Custom Error Pages

I've made some modifications to Global.asax so that I can show custom error pages (403, 404, and 500) Here's the code: public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { …
solidau
  • 4,021
  • 3
  • 24
  • 45
12
votes
7 answers

ELMAH display data in exception data dictionary

When using ELMAH (which is brilliant) is it possible to view extra information that you have added to an exception. E.g. Exception ex = new Exception("New exception to use ErrorSignal functionality"); ex.Data.Add("ExtraInfo", "Here is some extra…
Rob
  • 1,688
  • 4
  • 30
  • 43