[SERVER-18503] Replace log instances of database.$cmd with database.collection where applicable Created: 15/May/15  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Charlie Page Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: move-sa, platforms-re-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Case:

 Description   

Many commands operate on one and only one collection. The log would be easier to read if for these single collection targeted commands the format was <db>.<coll> instead of <db>.$cmd



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Comment by Adam Midvidy [ 18/May/15 ]

The issue here is that we would need to make the command log line specific to each command - logging of commands currently occurs before the command is fully parsed. Consequently, implementing this feature would result in considerable changes requiring additional testing and maintenance. It is more feasible to log the command name and database only.

Future versions of MongoDB will not use the <db>.$cmd namespace as we move to a new command protocol, so I expect the log line may change as part of that work.

Comment by Charlie Page [ 18/May/15 ]

Original log line:

2015-05-15T05:59:52.832+0000 I COMMAND  [conn92770] command MY_DATABASE.$cmd command: count { count: "my_collection", query: { ... } } planSummary: IXSCAN { ... } keyUpdates:0 writeConflicts:0 numYields:276 reslen:44 locks:{ Global: { acquireCount: { r: 277 } }, Database: { acquireCount: { r: 277 } }, Collection: { acquireCount: { r: 277 } } } 479ms

New log line:

2015-05-15T05:59:52.832+0000 I COMMAND  [conn92770] command MY_DATABASE.my_collection command: count { count: "my_collection", query: { ... } } planSummary: IXSCAN { ... } keyUpdates:0 writeConflicts:0 numYields:276 reslen:44 locks:{ Global: { acquireCount: { r: 277 } }, Database: { acquireCount: { r: 277 } }, Collection: { acquireCount: { r: 277 } } } 479ms

The $cmd is simply removed and replaced with the collection name.

Comment by Scott Hernandez (Inactive) [ 16/May/15 ]

Can you provide an example of what you expect to change, and how?

Generated at Thu Feb 08 03:47:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.