I have custom errors logging successfully, but there is an example of a failure error that I'd like to be notified by email, and can add this email trigger in my custom method.
Is there a way to trigger an email, either via the Log function, or as a custom method? I'm on 8.18.5 at this moment.
Trigger an email notification via code
I have custom errors logging successfully, but there is an example of a failure error that I'd like to be notified by email, and can add this email trigger in my custom method.
Is there a way to trigger an email, either via the Log function, or as a custom method? I'm on 8.18.5 at this moment.
Hi Jason,
You could install the serilog e-mail sink : https://github.com/serilog/serilog-sinks-email
And configure that with log level Error. That way all the errors will be e-mailed.
See the docs for configuration : https://our.umbraco.com/documentation/Reference/Configuration-for-Umbraco-7-and-8/Serilog/
Dave
Perfect. Thanks!
Hi Dave,
I am trying to use the Serilog email sink, however, I am unsure where to add the logger in Startup.cs. I am on Umbraco V13. Do you have a hint?
I know how to create the new LoggerConfiguration, but what I don't knwo is what to do with it then :-)
I try to do it in code, rather than in appsettings.json, since this way, it is easier to pull in secret credential information from other places.
Kind regards, Mikael
is working on a reply...