When creating the log directory add a sort of mkdir -p functionality