November Happy Hour will be moved to Thursday December 5th.

How can I configure exception emails to be sent to my email address?

Vote:
 

We have custom error pages set up for our EpiServer sites. It would be nice to have exceptions sent to my inbox.  This FAQ mentions an "EPsErrorMail" setting in web.config.

http://world.episerver.com/faq/items/customized-error-handling/

But it's unclear how to set this, and search engines turn up nothing helpful for the text "EPsErrorMail".  It would be helpful to see an example of how to set this in the web.config file. We are using EpiServer version 8.0. Thank you.

#151095
Edited, Jul 11, 2016 19:29
Vote:
 

I would use log4net and the email appender. There are plenty of example configuration for it. A little more advanced example with level and filter is:

<appender name="EmailAppender" type="log4net.Appender.SmtpAppender">

<evaluator type="log4net.Core.LevelEvaluator">

<threshold value="DEBUG"/>

</evaluator>

<!-- The filters are processed in order:

1) match the Inserted New User message

2) match any WARN or higher messages

3) reject everything else -->

<filter type="log4net.Filter.StringMatchFilter">

<stringToMatch value="Inserted a new user" />

<acceptOnMatch value="true" />

</filter>

<filter type="log4net.Filter.LevelRangeFilter">

<levelMin value="WARN" />

<acceptOnMatch value="true" />

</filter>

<filter type="log4net.Filter.DenyAllFilter" />

<!-- The SmtpAppender authenticates against the mail server, the buffersize of 10 provides 10 lines

of context when an error happens. -->

<subject value="LinkedCells: Production log event" />

<to value="notifications@LinkedCells.com" />

<from value="notifications@LinkedCells.com" />

<password value ="password" />

<smtpHost value="MAILSERVER" />

<bufferSize value="10" />

<lossy value="true" />

<layout type="log4net.Layout.PatternLayout">

<param name="ConversionPattern" value="%5p [%d] - %m%n" />

</layout>

</appender>
#151096
Jul 11, 2016 19:54
Vote:
 

Thanks Daniel! I'll give that a go.

#151098
Jul 11, 2016 20:00
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.