Log query (DEBUG level) before execute.

Pull request for issue #187