Where does ELMAH save its data?

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 section: <elmah> … <errorLog type=”Elmah.SqlErrorLog, Elmah” connectionStringName=”ElmahConnectionString”/> … Read more

How to secure Elmah.axd?

The typical scenario for securing elmah.axd is allowing only some authenticated user to be able to access it. But if your site doesn’t use any authentication at all this might not be applicable. Here’s what I would recommend you: Disable completely the elmah.axd handler on your main site Configure elmah to write the logs to … Read more

ELMAH – Exception Logging without having HttpContext

I’m answering my own question. I tried adding following in my web.config <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled=”true” /> </system.serviceModel> Also decorated my Service with following attribute [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] public class CalculatorService : ICalculatorSession { // Implement calculator service methods } Still no use. Then I got the solution here by which you can use Elmah without … Read more

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

You need to enable Elmah for remote access by adding the following configuration setting to the <elmah> section in your web.config file. The default setting for this value is false, which only allows localhost, hence why it is working on your local machine from within Visual Studio. <elmah> <security allowRemoteAccess=”true”/> </elmah> I always seem to … Read more

Does elmah handle caught exceptions as well

ELMAH has been updated to support a new feature called Signaling. This allows you to handle exceptions how you want, while still logging them to ELMAH. try { int i = 5; int j = 0; i = i / j; //Throws exception } catch (Exception ex) { MyPersonalHandlingCode(ex); ErrorSignal.FromCurrentContext().Raise(ex); //ELMAH Signaling } Re-throwing exceptions … Read more

Securing Elmah in ASP.NET website

I played around with the web.config and got the following to work. Basically instead of putting the elmah.axd HttpHandler in the general system.web, add it specifically in the system.web of your “admin” path location. <location path=”admin”> <system.web> <httpHandlers> <add verb=”POST,GET,HEAD” path=”elmah.axd” type=”Elmah.ErrorLogPageFactory, Elmah” /> </httpHandlers> <authorization> <deny users=”?”/> </authorization> </system.web> </location>