add parameter to set a log file
only check the log file if it is actually used.
Merge pull request #122 from darix/add_log_file_param

add parameter to set a log file