0

I am trying to log just errors in Backgroundjobs in Aspnet zero.

I can do it with given example in https://aspnetboilerplate.com/Pages/Documents/Audit-Logging;

    Configuration.Auditing.Selectors.Add(
    new NamedTypeSelector(
        "Abp.ApplicationServices",
        type => typeof (IApplicationService).IsAssignableFrom(type)
    )
);

but when I am trying to do this with Backgroud jobs it doesn't work.

 Configuration.Auditing.Selectors.Add(
          new NamedTypeSelector(
              "BackgroundJobs",
              type => typeof(IBackgroundJob<>).IsAssignableFrom(type)
          )
      ); 

It works just specific classes;

Configuration.Auditing.Selectors.Add(
              new NamedTypeSelector(
                  "BackgroundJobs",
                  type => typeof(IBackgroundJob<TestClass>).IsAssignableFrom(type)
              )
          ); 

What I want is just log all errors occured in classes implemented by IBackgroundJob<>.

aaron
  • 39,695
  • 6
  • 46
  • 102
Murat Can OĞUZHAN
  • 735
  • 11
  • 19

0 Answers0