Correct sql logging.