Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Linh Le 10 posts 121 karma points
    Aug 01, 2018 @ 06:50
    Linh Le
    0

    Email notification when site is down or getting errors

    Hi,

    I'm using Umbraco cloud. Is there any way to send email notification when site is down or geting errors?

    Thanks, Linh Le

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Aug 01, 2018 @ 08:24
    Alex Skrypnyk
    0

    Hi Linh Le

    The most reliable way to do it - use external ping service. Like https://pingdom.com

    You can specify email for getting emails when the exception occurs on the site, but it's not down, when everything is down you will not get an email :)

    Thanks,

    Alex

  • Phil Veloso 38 posts 251 karma points
    Jul 22, 2019 @ 21:06
    Phil Veloso
    0

    Hi Alex

    Do you know if there is there a way of hooking into the customErrors in order to trigger an email to be sent?

    The problem with a service like pingdom is that it doesn't cover all node urls.

    Thanks, Phil

  • Phil Veloso 38 posts 251 karma points
    Jul 22, 2019 @ 21:29
    Phil Veloso
    0

    Hi Linh,

    I have been able to achieve this my extending log4net, which Umbraco using as its logging framework.

    Add the following to your log4net configuration file:

    <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
        <to value="TO EMAIL ADDRESS" />
        <from value=”FROM EMAIL ADDRESS" />
        <subject value="Test Logging Message" />
        <smtpHost value="localhost" />
        <bufferSize value="512" />
        <lossy value="true" />
        <evaluator type="log4net.Core.LevelEvaluator">
            <threshold value="ERROR"/>
        </evaluator>
        <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%newline%date [%thread] %-5level %logger [%property{NDC}] - %message%newline%newline%newline" />
    </layout>
    

    Then add the following appender-ref element to the root section of the log4net config file:

    <appender-ref ref="SmtpAppender" />
    

    Hope this helps anyone who is interested!

Please Sign in or register to post replies

Write your reply to:

Draft