add log, write log file change var file to filename