Data Access Block logging

Topics: Building and extending application blocks, Data Access Application Block, Logging Application Block
May 30, 2007 at 4:18 PM
Does the Data Access Application Block support any kind of command parameter logging?

For example, if I call a stored procedure using the DAAB, can the DAAB log what stored procedure was called, the parameters passed to the stored procedure along with their values, and when the stored proc call started and when it returned?

If not, is there an easy way to extend the block to add this functionality? I know that I could write code all around my stored procedure calls to do this kind of logging, but I'm wondering if the DAAB provides a way to separate this sort of functionality from the application code.

Also, any other suggestions to achieve this sort of functionality would be appreciated.

May 30, 2007 at 5:34 PM
It does offer some intrumentation capabilities that you can read about in the doucmentation, but it doesn't offer the degree of information you want.

You could change the source code and add an event to the abstract Database Class that publishes such information. You would have to make those changes yourself, however.

Your best bet is have your own wrapper around the DAAB as opposed to sprinkling calls to the DAAB all around your application. You can then log this information yourself. You could also use the Policy Injection Application Block in coordination to help with the logging of parameter information.




David Hayden
Microsoft MVP C#