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>

Elmah not working with asp.net site

I just had a similar problem with Elmah not working in an IIS7 deployment. I found that I needed to register the Elmah Modules and Handlers in system.web AND system.webServer: <system.web> … <httpHandlers> … <add verb=”POST,GET,HEAD” path=”elmah.axd” type=”Elmah.ErrorLogPageFactory, Elmah” /> … </httpHandlers> <httpModules> … <add name=”ErrorLog” type=”Elmah.ErrorLogModule, Elmah”/> <add name=”ErrorMail” type=”Elmah.ErrorMailModule, Elmah” /> <add name=”ErrorFilter” … Read more

Send email from Elmah?

You need the ErrorMail httpModule. add this line inside the <httpModules> section <add name=”ErrorMail” type=”Elmah.ErrorMailModule, Elmah” /> If you’re using a remote SMTP server (which it looks like you are) you don’t need SMTP on the server.

What is the difference between log4net and ELMAH?

Log4Net is a general purpose logging framework with an API intended to be used within your application (web, console, dll, etc.). logger.Debug(“Some low level debug message…”); logger.Info(“Some basic info”); logger.Warn(“Some business logic problem, but not critical”); logger.Error(“An unexpected error”); ELMAH is an unobtrusive IIS plugin specifically for logging exceptions in a web application. You won’t … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)