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<>.