add log file function