Improve writing across multiple files.

Ran this against my local test server and while the writing isn't "even", neither file seems starved.

Fixes #245 
Fixes #244 
Please also move the `try` block into a new function so that logToFile can be optimized