Clean up logging
Exclude one more file
Clean up a few file writing related things

- Truncate file if it exists already
- Sync file to disk