made the log directory creation recursive