Improves audit of SQL queries

## Context 
The audit of SQL queries feature was generating some logs although it was disabled.

## Description
The feature has been improved to avoid logging anything when the feature is disabled.