Only create log file when installing.

This small patch avoids accumulating unnecessary log files due invalid
command line invocations by moving the log file creation to a later point in
time.
Merge pull request #3 from mavam/master

Avoid accumulating excess log files