Added automatic log directory creation