Fix log path

Adds a check for the logs directory. If the directory isn't found, it is automatically created.