c# Factory Pattern Generic Exception Handler using dot net core
Well, AddLogForException isn't doing anything with it's parameters, perhaps make it virtual or do something with them?

You could also add a rule engine stating if a exception is registered with a specific action then do that, else do default.

Your registration could be a dictionary or thread safe dictionary or dictionary  

say your class would have a backing field like this:

Dictionary&lt;exception, Action&lt;Exception,IHttpContextAccessor,string&gt;&gt; dict = new Dictionary&lt;exception, Action&lt;Exception,IHttpContextAccessor,string&gt;&gt;();


and you can register items like this 

public void Register(Exception ex, Action&lt;Exception,IHttpContextAccessor,string&gt; del)
{
   lock(this)
   {
      dict.Add(ex, del);
   }
}

public override AddLogForException&lt;T&gt;(
        T exception, 
        IHttpContextAccessor httpContext, 
        string description) 
        where T : Exception
    {

       if(dict.TryGetValue(exception, out var delegate)
       {
           delegate.DynamicInvoke(new object[]{exception,httpContext,description});
       }
       else 
           base.AddLogForException(exception,httpContext,description)
    }


This registration is similat to a swich statement only this is a way to manage the options in the consuming project and leaves room for updates as you go on a and adapt it on a case by case as long as your exceptions are granular enough that you can add a "rule" on them. 

I have no access to VS now but I guess it will compile just fine. if you have an issue just send me comment and I will have a look for you.