I have a timing interceptor for the services I use:
class TimingInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
var watch = new Stopwatch();
watch.Start();
try
{
invocation.Proceed();
}
finally
{
watch.Stop();
PosLogFactory.Default.Verbose(
"{0} ms spent on calling {1}"
, watch.Elapsed.TotalMilliseconds
, invocation.Method.Name
);
}
}
And I use this interceptor to get log information about the duration of my services calls.
I only want to have it when the services are called from a certain part of the application. Is there an option to suspend interceptor logs, when the services are called from a specific class?