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

Command log lines should include ok: 0 and errmsg:"..."

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.2
    • Affects Version/s: None
    • Component/s: Diagnostics
    • None
    • Minor Change
    • Sharding 2017-12-04, Sharding 2018-01-01, Sharding 2017-12-18, Sharding 2018-01-29, Sharding 2018-02-12

      Results from commands are often not available. This means that when commands are logged, if only the logfile is available it is impossible to know whether the command succeeded or failed.

      Thus log lines for failed commands should indicate ok:0, and include any errmsg:"..." that was in the command response.

      For example, the following situation:

      > rs.stepDown()
      replset:PRIMARY> rs.stepDown()
      {
          "closest" : NumberLong(0),
          "difference" : NumberLong(1434366203),
          "ok" : 0,
          "errmsg" : "no secondaries within 10 seconds of my optime"
      }
      

      should be logged as:

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      -2015-06-15T21:39:43.507+1000 [conn8] command admin.$cmd command: replSetStepDown { replSetStepDown: 60.0 } keyUpdates:0 numYields:0  reslen:132 0ms
      +2015-06-15T21:39:43.507+1000 [conn8] command admin.$cmd command: replSetStepDown { replSetStepDown: 60.0 } keyUpdates:0 numYields:0  ok:0 errMsg:"no secondaries within 10 seconds of my optime" errName:ExceededTimeLimit errCode:50 reslen:132 0ms
      

            Assignee:
            kevin.pulo@mongodb.com Kevin Pulo
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            4 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: