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

Log file should print extended json compliant syntax

    • Server Security

      We have extended json syntax for most types, see http://docs.mongodb.org/manual/reference/mongodb-extended-json/

      There are two flavors: "strict" and "shell" mode.

      Yet when certain types are printed in the log file, they don't comply to either of these formats, instead using arbitrary syntax that is hard to parse and cannot be simply copy&pasted back into the shell.

      All types should be printed as strict or shell syntax in the log for consistency. Preferably shell syntax since mongo shell can't yet understand strict syntax (see related ticket, SERVER-6813).

      Examples:

      Timestamp

      shell

      > Timestamp(1, 0)
      Timestamp(1, 0)
      

      log file

      Timestamp 0|0
      
      NumberLong

      shell

      > NumberLong("9223372036854775807")
      NumberLong("9223372036854775807")
      

      log file (would be misinterpreted as floating point value)

      9223372036854775807
      
      BinData

      shell

      > BinData(3, "0123456789ABCDEFFEDCBA9876543210")
      BinData(3,"0123456789ABCDEFFEDCBA9876543210")
      

      log file (quotes missing)

      BinData(3,0123456789ABCDEFFEDCBA9876543210)
      

      And so on.

            Assignee:
            backlog-server-security [DO NOT USE] Backlog - Security Team
            Reporter:
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            4 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated: