سؤال

Is there any magic that AppHarbor does with Elmah and SendGrid?

I see from this question Trouble using SendGrid with appharbor that AppHarbor does some configuration so an SMTP client can be initialized without parameters. I'm not sure what configuration is performed and whether it would apply to Elmah.

Elmah has a custom tag in the web.config but will it read the settings that AppHarbor configures by default?

Edit: If Elmah can't read those settings by default is there a way to use tokens to get replaced during the appharbor deploy process?

هل كانت مفيدة؟

المحلول

I put all the glue together thanks to a little testing and these two links:

http://support.appharbor.com/kb/getting-started/managing-environments http://scottonwriting.net/sowblog/archive/2009/05/21/163350.aspx

AppHarbor (I assume) is adding the SendGrid variables to <system.net> mailSettings in the web.config and Elmah will honor those settings. For a more secure configuration, you can add the useSsl="true" flag to <errorMail>

All I needed to add was the following:

<elmah>
    <!-- AppHarbor clears App_Data on each deploy -->
    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
    <errorMail from="error@a.com"
      to="admin@a.com"
      subject="Application Exception"
      async="false"
      smtpPort="0"
      useSsl="true"
    >
    </errorMail>
    <security allowRemoteAccess="true" />
</elmah>

AppHarbor and Elmah took care of the rest.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top