Skip to content

DOCSP-47538-log-path-and-id #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions source/includes/log-file-location.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Starting in |mdb-shell| 2.4.0, you can use the ``log.getPath()``
command to view the current log file location. For example:

.. code-block:: javascript

log.getPath()

Example output:

.. code-block:: javascript
:copyable: false

/Users/jane.doe/.mongodb/mongosh/c2961dbd6b73b052671d9df0_log

The hexadecimal value in the path is the |mdb-shell| log identifier for
the current session.
5 changes: 5 additions & 0 deletions source/logs/location.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ To view the current log file location, use the :ref:`config API
After you modify your log file location, you must start a new
|mdb-shell| session for the change to take effect.

Log File Location
~~~~~~~~~~~~~~~~~

.. include:: /includes/log-file-location.rst

Log File Names
~~~~~~~~~~~~~~

Expand Down
2 changes: 2 additions & 0 deletions source/logs/view.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ depends on your operating system.

To change where MongoDB Shell writes logs, see
:ref:`mongosh-log-location`.

.. include:: /includes/log-file-location.rst