I have used Elmah in multiple production ASP.Net applications and it
works like a charm.
a. We have some production windows services that use Event logs for
logging errors. These are not very manageable. I would like to have a
single source for logging and reporting errors. Can Elmah be used to
log errors by windows service??
b. I am able to send emails from my application using the
system.net
\mailSettings section but emails do not get triggered when an
unhandled error occurs and is logged in the elmah database. The email
settings in the elmah\errorMail section match the settings in the
system.net\mailSettings section. Here is my web.config. Could someone
look and see if I am making some obvious mistakes??
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false"
type="Elmah.SecuritySectionHandler, Elmah"/>
<section name="errorLog" requirePermission="false"
type="Elmah.ErrorLogSectionHandler, Elmah"/>
<section name="errorMail" requirePermission="false"
type="Elmah.ErrorMailSectionHandler, Elmah"/>
<section name="errorFilter" requirePermission="false"
type="Elmah.ErrorFilterSectionHandler, Elmah"/>
</sectionGroup>
</configSections>
<elmah>
<security allowRemoteAccess="1"/>
<errorLog type="Elmah.SqlErrorLog, Elmah"
connectionStringName="ElmahConnectionString"/>
<errorMail from="
ad...@abc.com" to="
StarFi...@abc.com"
subject="StarFire SVASS Error" async="true" smtpPort=""
smtpServer="
smtp.abc.com"/>
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="404" valueType="Int32"/>
</test>
</errorFilter>
</elmah>
<system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="POST,GET,HEAD" path="elmah.axd"
type="Elmah.ErrorLogPageFactory, Elmah"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
</httpModules>
</system.web>
<
system.net>
<mailSettings>
<smtp from="
ad...@abc.com">
<network host="
smtp.abc.com" password="" userName="" port="25"/>
</smtp>
</mailSettings>
</
system.net>
<connectionStrings>
<add name="ElmahConnectionString" connectionString="<actual
connection string>" providerName="System.Data.SqlClient"/>
</connectionStrings>