Added $logfile option