Monday 9 July 2007

logging in client proxy

I have found myself wondering what is a good logging strategy. There are several levels to consider, when you are implementing a client/proxy for an existing server. So far there are two major scenarios, where its interesting to log, one can be said to be sub case of the other.

-Regular logging where you are just interested in logging the fact that there is been send a request to the server, when, what and who.

-Debug logging where its interesting to look at the execution path through the client code. which will pinpoint anything strange. This can of cause also be done just by stepping through the code, but I would be much easier if one were able to insert enough debug writes to support an easy identification of the exceptional behavior.

Since the regular logging of the 3 w's is included in the debug logging, my plan is to include this info as a normal debug output, and then just filter it, to make the prober log file which is an requirement.

The overall strategy (using log4net) is the following levels:

- log fatal if the client losses the connection to the data source
- log error if there is thrown an exception or an err code is returned.
- log info when a workflow is finished. (for example the data written in a dump file)

More posts will follow of how to set up everything...

No comments: