fixed directory creation for logging to use recursive.