read map and write log to file