asp.net - ELMAH Logging in SQL Server -
i having elmah problem. think connection string can't figure out why. emailing me errors no problem, not logging them sql. if problem permissions, how catch error show me permission problem? here elmah relevant section of web.config:
<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" /> <section name="errortweet" requirepermission="false" type="elmah.errortweetsectionhandler, elmah" /> </sectiongroup>
<connectionstrings> <add name="errorlog" connectionstring="data source=sql1;initial catalog=asbestos;user id=myusername;password=mypassword" providername="system.data.sqlclient" />
<system.web> <httpmodules> <add name="errorlog" type="elmah.errorlogmodule, elmah" /> <add name="errormail" type="elmah.errormailmodule, elmah" /> <add name="errorfilter" type="elmah.errorfiltermodule, elmah" /> </httpmodules> </system.web> <system.webserver> <modules runallmanagedmodulesforallrequests="true"> <add name="errorlog" type="elmah.errorlogmodule, elmah" precondition="managedhandler" /> <add name="errormail" type="elmah.errormailmodule, elmah" precondition="managedhandler" /> <add name="errorfilter" type="elmah.errorfiltermodule, elmah" precondition="managedhandler" /> </modules> <validation validateintegratedmodeconfiguration="false" />
<elmah> <security allowremoteaccess="1" /> <errorlog type="elmah.sqlerrorlog, elmah" connectionstringname="errorlog"/> <errormail from="support@asbestos.phmc.org" to="ethan@phmc.org" subject="asbestos error log" async="true"></errormail> </elmah> <location path="elmah.axd" inheritinchildapplications="false"> <system.web> <authorization> <allow roles="system" /> <deny users="*" /> </authorization> <httphandlers> <add verb="post,get,head" path="elmah.axd" type="elmah.errorlogpagefactory, elmah" /> </httphandlers> </system.web> <system.webserver> <handlers> <add name="elmah" verb="post,get,head" path="elmah.axd" type="elmah.errorlogpagefactory, elmah" precondition="integratedmode" /> </handlers> </system.webserver> </location>
your config looks good. had same issue wasn't logging. had add execute permissions on elmah stored procs credentials using connect db.
Comments
Post a Comment