Make logfile optional and configurable