Title: Method Profiler

Hi all,

Does any library/component exist for logging an event in log4net if method execution time is bigger than predefined period?

In other words, we need to log warning or error event in log4net if method executes more than X millisecods, something like Profiler in MS EntLib but logging only when method execution time cross a predefined threshold.

If there is no such component, does the community interested in such library. Just to know, do we need design it for more generic usage?

Method code can look like:

void Bar()
{
        using(LogProfiler logProfiler
         = new LogProfiler(log /*log4net.Ilog*/,        getProfilerThreshold("Foo.Bar"))
        //severity, description can be add here
        {
                //Do method job here
        }
}

Regards, Andrej

Reply via email to