You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by Andrej Golcov <an...@hermes.si> on 2006/01/23 11:23:34 UTC

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