Fixes #9516. Ensure "user_dir" exists...

Before attempting to create entries below it.
Revert to using printf for printing error message when we can't write to a logfile.