add log file with sql query