Use the new logfile API
Use the new logfile API
Use mode_t, and create any necessary directories