locked
Default to e-mail address in health monitoring provider in root web.config RRS feed

  • Question

  • User-1486087731 posted

    Howdy,

    We're trying to find a way to have the health monitoring e-mails of all our applications be sent to one e-mail address, without having to specify that e-mail address in every application's web.config.  We were thinking this might be possible via the Root Web.config, which defaults values in application web.configs.

    Example Application Web.Config:

    <system.web>
        <healthMonitoring enabled="true" >
          <providers>
            <add name="FilteredMailWebEventProvider"
                 type="So.Esi.MvcFramework.Utility.HealthMonitoring.FilteredMailWebEventProvider"
                 buffer="true"
                 bufferMode="Notification"
                 maxMessagesPerNotification="10"
                 maxEventsPerMessage="10"
                 subjectPrefix="App Name"/>

    Example Root Web.Config (our attempt):

    <healthMonitoring>    
    <
    providers>      
    <
    add name="FilteredMailWebEventProvidertype="So.Esi.MvcFramework.Utility.HealthMonitoring.FilteredMailWebEventProviderto="one-email-to-rule-them-all@domain.edu" from="one-email-to-rule-them-all@domain.edu"/>   
    </
    providers>

    Thanks in advance,

    Andrew

    Monday, January 29, 2018 2:22 PM

All replies

  • User283571144 posted

    Hi abeehler,

    We're trying to find a way to have the health monitoring e-mails of all our applications be sent to one e-mail address, without having to specify that e-mail address in every application's web.config.  We were thinking this might be possible via the Root Web.config, which defaults values in application web.configs.

    Example Application Web.Config:

    According to your description, I couldn't understand clearly about how you host your applications.

    Do you mean you have multiple folder in one application and each folder has its own web.config?

    If this is your opinion, the root web config setting will work if you don't override the setting in the folder's web.config.

    More details, you could refer to below article.

    https://dzone.com/articles/working-more-one-webconfig 

    Best Regards,

    Brando

    Tuesday, January 30, 2018 5:53 AM
  • User-1486087731 posted

    Brando,

    Thank you for the response.  We host our applications in IIS on a dedicated server.  Each application is in its own directory with its own web.config.  We do not have multiple web.configs in a single application.  The Root Web.config I'm referring too is at systemroot\Microsoft .NET\Framework\versionNumber\CONFIG\.  I've tinkered with the Root Web.config, but I'm unable to get the it default the TO and FROM attributes of a specific healthMonitoring provider.

    Let's say we have Apps A, B, and C.  Each App has a web.config.  Apps A and B have healthMonitoring configured.  We want both Apps A and B to send its healthMonitoring e-mails to the same e-mail address, without having to put that e-mail address in each web.config.  We'd figure we could do something in the Root Web.Config to default the TO e-mail address for applications that have healthMonitoring configured.

    Quick Tangent: why does the subjectPrefix attribute only work with SimpleMailWebEventProvider and TemplatedMailWebEventProvider? (https://msdn.microsoft.com/en-us/library/y6d9ss59%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396)

    Wednesday, January 31, 2018 2:51 PM
  • User475983607 posted

    Put the email in a database or an XML file located a share that all apps can see.

    Wednesday, January 31, 2018 2:56 PM