Google Analytics and other tools could help you monitor your application in a generic way. If there has been a few users or clients who keep complaining about performance of your application, you'll need to monitor their activities and the system response time for these users in particular.

With the help of MiniProfiler and Log4Net, this task can be done within an hour.

Before we start, here are my assumptions:

Your application is an ASP .NET MVC or Web Forms application.

You want to know how long it takes the server to serve the HTTP requests from the moment your application receive the request until a response has been sent out.The metric of choice is milliseconds.

You have your client or user ID saved in Session right after they login to the application.

After you have done all the hard work, you should see a similar result:

Let’s do it.

Right click your application in the Solution Explorer to Manage NuGet Packages. Then search and install MiniProfiler.

You should see a new reference added to your project.Commit or check-in your code to source control now if you have one.

Next, use NuGet again to install Log4Net.

And you’ll see new reference:Commit or check-in your code to source control now if you have one.

If you have a multi-tiered architect, you need to consult your team about which tier, project or folder you should place the new code that I will give to you in next step. If you don’t have multi-tiered architect (meaning, separate projects for MVC, Logic, Data Access,…), you should create the special App_Code folder:

Copy and Paste the Profiler class to under the App_Code or your folder of choice:

This code has 2 classes: Profiler and ProfilerSetting (this is a nested class).The Profiler class reads the current user’s login ID from the Session using the key “CurrentUser.LoginID”.The ProfilerSetting class reads a list of user login IDs from web.config file.

Create the config entry for indicating whose requests should be profiled.In this example, I presume usernames are email addresses.