options to write log to a file and to rotate file daily

Added daemon options so the user can specify if the log will be written to a file, and give the desired filename, and specify if the files should be rotated daily, creating a new log file for each day.