Changing the Log and Storage Directories for MongoDB on macOS

Open a terminal session and open /usr/local/etc/mongod.conf

systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  dbPath: /usr/local/var/mongodb
net:
  bindIp: 127.0.0.1

Make the required changes to path and dbPath and start/restart your service.

systemLog:
  destination: file
  path: /Users/mark/devops/mongo-logs/mongo.log
  logAppend: true
storage:
  dbPath: /Users/mark/devops/mongo-data
net:
  bindIp: 127.0.0.1