I'm using Elmah and what I would like to happen is that when one of our multiple developers is running their project locally, they only receive any error emails generated from that local instance, if the error is generated on the live server, email a different (group) email. Right now we are just using the (horrible) method of each person having their own web.config that shouldn't (but sometimes does) get committed to our Repo, and then changing the email string when deploying to live.
We are all using VS 2010 and Cassini, but the developers could be working from their work computer or their home computer where they connect through VPN, but their login name on their home computer doesn't reflect their work computer username.
Basically all I have so far is this ELMAH email setting:
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ElmahDb" />
<errorMail from="no-reply@mydomain.com" to="myemail@mydomain.com" subject="Project Error" smtpPort="0" async="false" />
And an empty method in Application_Start:
protected void Application_Start()
{
Config.SetErrorEmailReceiver();
}
public static void SetErrorEmailReceiver()
{
//some logic
}