Add option for logging to a file.

Useful in daemon mode.
Merge pull request #103 from jaymzh/logfile

Add option for logging to a file.