Implemented logging system.

Now it no longer logs to console which generated mail in cronjobs.
Instead a new log file is generated every day and all logs are
stored in the day's log file. Will eventually need to have clean
up and such.