Fixing a missed commit - function to log file.