Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1591

Change field order of bson documents sent to server for better logging

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.9.0.rc0
    • Affects Version/s: None
    • Component/s: Dev Exp
    • None
    • 2

      Currently the logs on 4.0 with mongoid are as follows:

      MONGODB | localhost:27101 | mongoid.insert | STARTED | {"insert"=>"users", "ordered"=>true, "$clusterTime"=>{"clusterTime"=>#<BSON::Timestamp:0x000055a2e8bbbe40 @seconds=1542390914, @increment=1>, "signature"=>{"hash"=><BSON::Binary:0x47079088839660 type=generic data=0x0000000000000000...>, "keyId"=>0}}, ...
      
      MONGODB | localhost:27101 | mongoid.update | STARTED | {"update"=>"users", "ordered"=>true, "$clusterTime"=>{"clusterTime"=>#<BSON::Timestamp:0x000055a2e8990a08 @seconds=1542390915, @increment=4>, "signature"=>{"hash"=><BSON::Binary:0x47079087703160 type=generic data=0x0000000000000000...>, "keyId"=>0}}, ...
      

      I take it the actual data being inserted is later in the bson document, and gets truncated. The first third of the log entry is thus useful in that it says an insert is happening, but the last two things are not too useful and the actual insert data is nowhere to be seen.

      This can be worked around by installing a custom logger which does not truncate the output, but the driver can put together the fields in a different order to provide much more useful log output out of the box.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: