jeudi 15 septembre 2016

Logging Features/Functions Used In an Application

Here's the scenario: I am trying to keep myself and fellow employees from wasting time on programming fixes on features that are never used by users. I work on an application that has been around for 10 years and has a lot of features that may never be used by customers, even though at some point they were. I find myself going down rabbit holes fixing problems that were never reported because QA and customers never encountered them. I don't want to leave in code that has significant problems but I also can't just remove it because perhaps parts of that class is used elsewhere.

I proposed some sort of a logging architecture that keeps track of every function call or Object creation within the application while a user uses the application. This way we can ask customers for the logging file stored somewhere in a folder we create. Once we obtain all the logs from all our users after a certain amount of time (1-2 months or so) we can analyze the logs and see exactly which features and functions are being used. I believe this data will be super useful in discovering how our customers are using our application. It can also point to features in our application that simply never get used and which features are used the most.

What would be a good solution/architecture, design pattern to implement this logging feature into an existing large code base? Or is this just simply a bad idea all together?

My initial thought would be something like this but with an extremely large application this would take a while. Plus it doesn't look great to have something like this in every single method but perhaps it's the only way?

private void createData()
{
   write.toLog("ClassName.createData");
   //the magic of the createData function
}

Aucun commentaire:

Enregistrer un commentaire