Add better checking for log file writing, log when we start/stop recording
Added $logheader to limit summary logging frequency, defaulting to 10 minutes