Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-986

toString of MongoClientOptions is inadequate

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.12.0
    • None
    • None
    • None

    Description

      The toString of a MongoClient does a really good job of documenting the Options that it was created with like

      Mongo{authority=MongoAuthority{type=Set, serverAddresses=[bobk-mbp.local/10.78.4.164:27017, bobk-mbp.local/10.78.4.164:27018], credentials={credentials={}}}, options=MongoOptions{description='null', connectionsPerHost=10, threadsAllowedToBlockForConnectionMultiplier=5, maxWaitTime=2000, connectTimeout=2000, socketTimeout=2000, socketKeepAlive=false, autoConnectRetry=false, maxAutoConnectRetryTime=0, slaveOk=false, readPreference=primary, dbDecoderFactory=DefaultDBDecoder.DefaultFactory, dbEncoderFactory=DefaultDBEncoder.DefaultFactory, safe=false, w=0, wtimeout=0, fsync=false, j=false, socketFactory=javax.net.DefaultSocketFactory@446d0fff, cursorFinalizerEnabled=true, writeConcern=WriteConcern

      { "getlasterror" : 1}

      / (Continue Inserting on Errors? false), alwaysUseMBeans=false}}

      The MongoClientOptions object fails to do the same job making my logging unable to pro-actively log the options I am about to open a Mongo connection with:

      com.mongodb.MongoClientOptions@af9cc855

      I would really like to see the toString of MongoClientOptions produce a toString identical to what the MongoClient's toString produces as options=MongoOptions.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bob_kuhar Bob Kuhar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: