|
| 1 | +.. _compass-logs: |
| 2 | + |
| 3 | +===================== |
| 4 | +Retrieve Compass Logs |
| 5 | +===================== |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 1 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +As part of normal operation, |compass| maintains a running log of |
| 16 | +events. |compass-short| logs provide a history of operations and can |
| 17 | +help diagnose errors. |
| 18 | + |
| 19 | +.. note:: |
| 20 | + |
| 21 | + |compass| redacts credentials from the logs. |
| 22 | + |
| 23 | +View Compass Logs |
| 24 | +----------------- |
| 25 | + |
| 26 | +.. procedure:: |
| 27 | + :style: normal |
| 28 | + |
| 29 | + .. step:: In the |compass-short| top menu bar, click :guilabel:`Help`. |
| 30 | + |
| 31 | + .. step:: In the :guilabel:`Help` menu, click :guilabel:`Open Log File`. |
| 32 | + |
| 33 | + |compass-short| opens a dialog containing the location of your log file. |
| 34 | + |
| 35 | + .. step:: Choose how to open the log file. |
| 36 | + |
| 37 | + You can either: |
| 38 | + |
| 39 | + - Copy the path to the log file to your clipboard. |
| 40 | + |
| 41 | + - Open the folder containing your log file. |
| 42 | + |
| 43 | + - Extract the log file and view it as a text file. |
| 44 | + |
| 45 | +Compass Log Location |
| 46 | +-------------------- |
| 47 | + |
| 48 | +|compass-short| maintains one log file per session, compressed into a |
| 49 | +gzip archive file. The corresponding session ID is included in the log |
| 50 | +file name. |
| 51 | + |
| 52 | +The directory where |compass-short| writes logs depends on your |
| 53 | +operating system. |
| 54 | + |
| 55 | +.. list-table:: |
| 56 | + :header-rows: 1 |
| 57 | + :stub-columns: 1 |
| 58 | + :widths: 10 20 |
| 59 | + |
| 60 | + * - Operating System |
| 61 | + - Directory |
| 62 | + * - macOS |
| 63 | + - ``~/.mongodb/compass/<LogID>_log.gz`` |
| 64 | + * - Linux |
| 65 | + - ``~/.mongodb/compass/<LogID>_log.gz`` |
| 66 | + * - Windows |
| 67 | + - ``%UserProfile%/AppData/Local/mongodb/compass/<LogID>_log.gz`` |
| 68 | + |
| 69 | +Log File Format |
| 70 | +--------------- |
| 71 | + |
| 72 | +|compass-short| outputs log messages in structured JSON format. The |
| 73 | +messages are written in the same format used for MongoDB server logs. |
| 74 | + |
| 75 | +.. seealso:: |
| 76 | + |
| 77 | + To learn more about MongoDB logs and see examples, see |
| 78 | + :ref:`log-messages-ref`. |
| 79 | + |
| 80 | +Log Retention |
| 81 | +------------- |
| 82 | + |
| 83 | +|compass-short| retains log files for 30 days. Log files older than 30 |
| 84 | +days are automatically deleted. |
0 commit comments