Add support for logging the time taken in SQL calls

This PR adds support for logging MySQL SQL calls, although I'm not sure how well this approach could be extended to other databases.

It's possible a more extensible strategy would be to do something similar to what the jdbcspy library does (https://code.google.com/p/jdbcspy/).