-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Diagnostics, Querying
-
Query Execution
-
(copied to CRM)
ISSUE DESCRIPTION
Currently, the following behavior is observed for the $comment field displayed in the mongodb logs.
- The $comment field's length gets truncated to 150 characters, when it is captured in the logs.
- Increasing the value for maxLogSizeKB, makes no difference. The $comment field length still gets truncated in the logs at 150 characters.
REPRODUCER
1. The following command can be run in the mongo shell - note the `AB` at the end of the $comment string:
replset:PRIMARY> db.<collectionName>.aggregate([ { $match: { $comment: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXAB"} } ])
2. In the logs it will be observed that the $comment field gets truncated (note the `...` and no `AB` at the end):
command test.<collectionName> appName: "MongoDB Shell" command: aggregate { aggregate: "<collectionName>", pipeline: [ { $match: { $comment: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..." } } ]
3. Performing a character count on the length of the $comment field (the "XXXX...") will show they are `150 `characters.
FEATURE REQUEST
Requesting for a feature that allows for changing the length of the $comment field displayed in the logs.
- is duplicated by
-
SERVER-38809 Ensure "comment" field is always present in logfile entries, even when maxLogSizeKB is exceeded
- Closed
- is related to
-
SERVER-29794 Adding a comment to all commands
- Closed
-
SERVER-27439 Large queries can omit comment in currentOp
- Closed
-
SERVER-28128 Add support for a "comment" parameter to the aggregate command
- Closed