SQL query logging for debugging

I have the same question