Disable query logging when the profiler is disabled.