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
953 questions
567
votes
8 answers

How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?

I am trying to use ELMAH to log errors in my ASP.NET MVC application, however when I use the [HandleError] attribute on my controllers ELMAH doesn't log any errors when they occur. As I am guessing its because ELMAH only logs unhandled errors and…
dswatik
  • 8,999
  • 10
  • 36
  • 52
267
votes
10 answers

How to use ELMAH to manually log errors

Is it possible to do the following using ELMAH? logger.Log(" something"); I'm doing something like this: try { // Code that might throw an exception } catch(Exception ex) { // I need to log error here... } This exception will not be…
Omu
  • 64,955
  • 87
  • 259
  • 396
128
votes
18 answers

Could not load file or assembly 'System.Data.SQLite'

I've installed ELMAH 1.1 .Net 3.5 x64 in my ASP.NET project and now I'm getting this error (whenever I try to see any page): Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, …
pupeno
  • 256,034
  • 114
  • 324
  • 541
108
votes
7 answers

What is the difference between log4net and ELMAH?

Some people are using ELMAH instead of log4net. What makes it better? I found out about ELMAH in an answer to Stack Overflow question How do I do logging in C#?
IAdapter
  • 55,820
  • 69
  • 166
  • 236
87
votes
3 answers

Send email from Elmah?

Is anyone using Elmah to send exceptions via email? I've got Elmah logging set up via SQL Server, and can view the errors page via the Elmah.axd page, but I am unable to get the email component working. The idea here is to get the email notification…
Mark Struzinski
  • 31,745
  • 33
  • 103
  • 135
80
votes
7 answers

Elmah not working with asp.net site

I've tried to use elmah with my asp.net site but whenever I try to go to http://localhost:port/elmah.axd I get resource not found exception. My web.config is given below.
TheVillageIdiot
  • 38,082
  • 20
  • 126
  • 184
65
votes
7 answers

Using ELMAH in a console application

I just started using ELMAH and am a fan. My team supports a large number of web applications and I'm particularly excited that ELMAH lets us save exceptions from each application to the same MS SQL database table. We also support a few console, DLL…
Michael La Voie
  • 26,205
  • 14
  • 68
  • 92
62
votes
6 answers

Exception Logging for WCF Services using ELMAH

We are using the excellent ELMAH to deal with unhandled exceptions in an ASP.NET 3.5 web application. This works extremely well for all of the site apart from WCF services which are being consumed using the REST features. When an exception occurs…
Martin Hollingsworth
  • 7,021
  • 7
  • 44
  • 49
59
votes
4 answers

Securing Elmah in ASP.NET website

I am having trouble trying to secure ELMAH. I have followed Phil Haacked's tutorial, with the only difference being the demo project is a web application and my project is a website.
Justin Svetlik
  • 693
  • 1
  • 6
  • 8
55
votes
2 answers

Does elmah handle caught exceptions as well

Does ELMAH logged exceptions even when they do not bubble up to the application? I'd like to pop up a message when an exception occurs and still log the exception. Currently I've been putting everything in try catch blocks and spitting out…
Chris Westbrook
  • 1,768
  • 5
  • 20
  • 34
55
votes
2 answers

How can you get the "real" HttpContext within an ASP.NET MVC application?

Unfortunately, I need to do this. I'm using ELMAH for my error log. Before I route to my error.aspx view, I have to grab the default ELMAH error log so I can log the exception. You used to be able to use Elmah.ErrorLog.Default However, this is…
user1228
55
votes
2 answers

Can't access /elmah on production server with Elmah MVC?

I installed the elmah.mvc nuget package and kept the default configuration of that sans setting up sending an email and plugging it into a SQL database. On my local machine when I use the Visual Studio host, I can open my app and access /elmah fine…
SventoryMang
  • 9,656
  • 12
  • 66
  • 103
51
votes
4 answers

ELMAH - Exception Logging without having HttpContext

I tried this solution with Elmah.XmlFileErrorLog but I'm getting following exception System.ArgumentNullException was unhandled by user code Message="Value cannot be null.\r\nParameter name: context" Source="Elmah" ParamName="context" …
IsmailS
  • 10,338
  • 18
  • 73
  • 128
47
votes
7 answers

How to secure Elmah.axd?

We're using Elmah as our error logging system for an app that will be going into production soon. It's extremely useful, but if it goes into production like this anyone in the world access the error log because all they have to do is visit…
DaveDev
  • 38,095
  • 68
  • 199
  • 359
42
votes
4 answers

elmah: exceptions without HttpContext?

I spawn a thread on Application_Start and would like to log exceptions. There is no Context/HttpContext/HttpContext.Current, so how might I get it to log? At the moment, it does not catch any exception in my threads and if I write…
user34537
1
2 3
63 64