Fix sql log panel

This updates the SQL log panel to work with the 3.0 database layer. I will update the pull request tonight with tests if no one has serious objections to the general direction of these changes.
You just had to go and move it on me .