How to log deployed application for debugging?
What applications would allow me to log methods and parameters after compile time?
Here is the problem that I am having. The application is deployed, and a customer has an unreproducible bug.
Its enterprise software so every customer needs to be happy. I was wondering if there was any way to log selected methods in an application once deployed to the client.I was thinking about creating a program with the following workflow and I was wondering if it already existed so I wouldn't have to reinvent the wheel.
1.UI front end tha开发者_运维百科t allowed you to select methods in the assembly.
2.Then it would output an xml with information on which methods were selected. 3.A second application on the client side would read this xml and patch the assembly causing it to log information to a text file.This seems like a simple enough program for simple functions that would be incredibly useful. So I assume it is out there somewhere I just can't seem to find where.
Edited for clarity.
Using a time-tested logging framework like log4net, which is a port from the even more-time-tested Java log4j, you can have complete control and flexibility.
You can add logging code, but not actually do any logging unless you turn it on, which you can do on a customer-by-customer basis. Furthermore, it is fully customizable as to how and where it logs.
You still need to put the logging in your code and deploy an update, but once it is out there, you can enable or disable it, even in a running application. You can set up log4net to watch for changes to its config file, so if you change the config to enable logging or change its output, logging will begin without having to restart the application.
精彩评论