I am fighting now with a strange problem. Earlier we used to write filters to log handled errors with Elmah like described in this forum: How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?
public void OnException(ExceptionContext context)
{
if (context.ExceptionHandled)
{
// Log here with my standard logger, which logs errors to Elmah as well
ILogger logger = this.loggerFactory.GetLogger(), context.HttpContext);
logger.Error("...");
}
}
This used to work somehow year ago. Now I am having exactly oposite problem and cannot figure what changed. Elmah is somehow logging handled Action erros even if handled by standard Error attribute. So with my Filter everything is in elmah twice. I searched complete app for any elmah/logging stuff and connot find anything suspicious. Of course I could create some workaround to avoid logging with elmah in my Filter, but I would like to know what happend or chanded in Elmah so it is not working anymore. Similar question without answere is here: How to prevent Elmah logging errors handled in a Error Attribute
Could someone please give me advice how configure elmah correctly? I am using Elmah.MVC 2.1.1 and elmah.corelibrary 1.2.2 if it matters.
thx!