Add flush_interval flag to allow customized flush intervals.
Fix logging to file functionality so that it creates the specified log directories if they don't exist
Require the user to call StartLogging() so that flush_interval is respected from the start.