[SERVER-27023] Make documents listed in mongod log easier to manipulate Created: 14/Nov/16  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Logging
Affects Version/s: 3.4.0-rc2
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Daniel Coupal Assignee: Backlog - Security Team
Resolution: Unresolved Votes: 0
Labels: move-sec, platforms-re-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Server Security
Participants:

 Description   

In the mongod logs, we sometimes display documents for the purpose of providing additional details.
However, those documents may be hard to read from the log, for example the recently added initial sync statistics:

{ failedInitialSyncAttempts: 0, maxFailedInitialSyncAttempts: 10, initialSyncStart: new Date(1478554918366), initialSyncEnd: new Date(1478554939872), initialSyncElapsedMillis: 21506, initialSyncAttempts: [ { durationMillis: 16118, status: "OK", syncSource: "localhost:27018" } ], fetchedMissingDocs: 0, appliedOps: 2, initialSyncOplogStart: Timestamp 1478554918000|1, initialSyncOplogEnd: Timestamp 1478554938000|1, databases: { databasesCloned: 2, admin: { collections: 1, clonedCollections: 1, start: new Date(1478554923755), end: new Date(1478554923843), elapsedMillis: 88, admin.system.version: { documentsToCopy: 1, documentsCopied: 1, indexes: 2, fetchedBatches: 1, start: new Date(1478554923756), end: new Date(1478554923843), elapsedMillis: 87 } }, m034: { collections: 2, clonedCollections: 2, start: new Date(1478554923843), end: new Date(1478554939871), elapsedMillis: 16028, m034.companies: { documentsToCopy: 932, documentsCopied: 932, indexes: 3, fetchedBatches: 1, start: new Date(1478554923844), end: new Date(1478554923990), elapsedMillis: 146 }, m034.people: { documentsToCopy: 883314, documentsCopied: 883314, indexes: 3, fetchedBatches: 21, start: new Date(1478554923990), end: new Date(1478554939871), elapsedMillis: 15881 } } } }

It would be nice to print those documents in a format such that someone could simply cut/paste the document inside an insert() command in the shell and then run a find().pretty() on it to see it in a more friendlier format.



 Comments   
Comment by William Cross [ 30/Nov/16 ]

acm, I like daniel.coupal's assessment: If you think that this ticket is likely to get prioritized over SERVER-18240 due to that ticket's scope, I would favor keeping this one.

Generated at Thu Feb 08 04:13:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.