Append .log to file writer filenames

Use a .log suffix for filenames generated by the file writer.

Improve error handling in the CLI.