Add Query logging support