Skip to content
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

DOCSP-48327: Address technical feedback on Logging page #219

Merged
merged 4 commits into from
Mar 13, 2025
Merged
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
9 changes: 8 additions & 1 deletion source/logging.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ logging library, see the `Python logging library documentation <https://docs.pyt
Examples
--------

The follwing example sets the global logging level to ``INFO``:
The following example sets the global logging level to ``INFO``:

.. code-block:: python

Expand All @@ -52,6 +52,13 @@ The following example sets the log level on the ``pymongo.command`` component to
import logging
logging.getLogger("pymongo.command").setLevel(logging.DEBUG)

Messages that the driver outputs will have the log level specified at the beginning of the
message, as shown by this example ``DEBUG`` message:

.. code-block:: none

DEBUG:pymongo.command:{"clientId": {"$oid": "..."}, "message": "Command started", "command": "{\"insert\": \"test\", \"ordered\": true, \"lsid\": {\"id\": {\"$binary\": {\"base64\": \"...\", \"subType\": \"04\"}}}, \"$db\": \"db\", \"documents\": [{\"x\": 1, \"_id\": {\"$oid\": \"...\"}}]}", "commandName": "insert", "databaseName": "db", "requestId": ..., "operationId": ..., "driverConnectionId": 1, "serverConnectionId": 3554, "serverHost": "localhost", "serverPort": 27017}

Configuring Truncation
----------------------

Expand Down
Loading