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

escape double quotes \" when printing strings to log

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Logging, Usability
    • Server Security

      A query like this:

      db.foo.find({a: "\"i'm a quoted text\""})
      

      is printed to the log file like so:

      2014-12-21T15:43:14.894+1100 I QUERY    [conn5] query test.foo query: { a: ""i'm a quoted text"" } planSummary: EOF ...
      

      The inner quotes are not escaped. This makes parsing this string with json/javascript parsers impossible.

      Instead, it should be printed like so:

      2014-12-21T15:43:14.894+1100 I QUERY    [conn5] query test.foo query: { a: "\"i'm a quoted text\"" } planSummary: EOF ...
      

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

              Created:
              Updated:
              Resolved: