Added error when logs can't be written to to help with troubleshooting.