Docs Home / Compass / Troubleshooting

Retrieve Compass Logs

As part of normal operation, MongoDB Compass maintains a running log of events. Compass logs provide a history of operations and can help diagnose errors.

Note

MongoDB Compass redacts credentials from the logs.

View Compass Logs

1

In the Compass top menu bar, click Help.

2

In the Help menu, click Open Log File.

Compass opens a dialog containing the location of your log file.

3

Choose how to open the log file.

You can either:

  • Copy the path to the log file to your clipboard.
  • Open the folder containing your log file.
  • Extract the log file and view it as a text file.

Compass Log Location

Compass maintains one log file per session, compressed into a gzip archive file. The corresponding session ID is included in the log file name.

The directory where Compass writes logs depends on your operating system.

Operating SystemDirectory
macOS~/.mongodb/compass/<LogID>_log.gz
Linux~/.mongodb/compass/<LogID>_log.gz
Windows%UserProfile%/AppData/Local/mongodb/compass/<LogID>_log.gz

Log File Format

Compass outputs log messages in structured JSON format. The messages are written in the same format used for MongoDB server logs.

Tip

To learn more about MongoDB logs and see examples, see Log Messages.

Log Retention

Compass retains log files for 30 days. Log files older than 30 days are automatically deleted.