Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27023

Make documents listed in mongod log easier to manipulate

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: 3.4.0-rc2
    • Fix Version/s: Backlog
    • Component/s: Logging

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated: