You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/fundamentals/connection/mongoclientsettings.txt
+98-59Lines changed: 98 additions & 59 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ To create a ``MongoClientSettings`` object, use the
42
42
settings. After chaining them, use the ``build()`` method to create the
43
43
``MongoClientSettings`` object.
44
44
45
-
The following table describes all the methods you can chain to modify your
45
+
The following table describes the methods you can chain to modify your
46
46
connection behavior:
47
47
48
48
.. list-table::
@@ -71,6 +71,10 @@ connection behavior:
71
71
- Applies the ``ConnectionPoolSettings.Builder`` block and then sets the
72
72
:ref:`connection pool settings <mcs-connectionpool-settings>`.
73
73
74
+
* - ``applyToLoggerSettings()``
75
+
- Applies the ``LoggerSettings.Builder`` block and then sets the
76
+
:ref:`logger settings <mcs-logger-settings>`.
77
+
74
78
* - ``applyToServerSettings()``
75
79
- Applies the ``ServerSettings.Builder`` block and then sets the
76
80
:ref:`server settings <mcs-server-settings>`.
@@ -201,7 +205,7 @@ Chain the `applyToClusterSettings() <{+api+}/apidocs/mongodb-driver-core/com/mon
201
205
method to modify the driver's behavior when interacting with your
202
206
MongoDB cluster.
203
207
204
-
The following table describes all the methods you can chain to your
208
+
The following table describes the methods you can chain to your
205
209
settings to modify the driver's behavior:
206
210
207
211
.. list-table::
@@ -289,60 +293,6 @@ regardless of the type of MongoDB cluster its' a part of:
289
293
in your connection URI. See :ref:`<connection-options>` for more
290
294
information.
291
295
292
-
.. _mcs-socket-settings:
293
-
294
-
Socket Settings
295
-
---------------
296
-
297
-
Chain the `applyToSocketSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToSocketSettings(com.mongodb.Block)>`__
298
-
method to modify the driver's behavior when connecting and communicating
299
-
with your MongoDB server.
300
-
301
-
The following table describes all the methods you can chain to your settings
302
-
to modify the driver's behavior:
303
-
304
-
.. list-table::
305
-
:widths: 40 60
306
-
:header-rows: 1
307
-
308
-
* - Method
309
-
- Description
310
-
311
-
* - ``applyConnectionString()``
312
-
- Uses the settings from a ``ConnectionString`` object.
313
-
314
-
* - ``applySettings()``
315
-
- Uses the socket settings specified in a ``SocketSettings`` object.
316
-
317
-
* - ``connectTimeout()``
318
-
- Sets the maximum time to connect to an available socket before throwing
319
-
a timeout exception.
320
-
321
-
* - ``readTimeout()``
322
-
- Sets the maximum time to read to an available socket before throwing a
323
-
timeout exception.
324
-
325
-
* - ``receiveBufferSize()``
326
-
- Sets the socket's buffer size when receiving.
327
-
328
-
* - ``sendBufferSize()``
329
-
- Sets the socket's buffer size when sending.
330
-
331
-
Example
332
-
~~~~~~~
333
-
334
-
This example specifies the following driver behavior in a MongoDB socket:
335
-
336
-
- To connect to an available socket within ``10 SECONDS``
337
-
- To read from an available socket within ``15 SECONDS``
Chain the `applyToConnectionPoolSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToConnectionPoolSettings(com.mongodb.Block)>`__
352
302
method to modify the way the driver manages its connection pool.
353
303
354
-
The following table describes all the methods you can chain to your
304
+
The following table describes the methods you can chain to your
355
305
settings to modify the driver's behavior:
356
306
357
307
.. list-table::
@@ -421,6 +371,41 @@ This example specifies the following driver behavior in a pool of
421
371
:emphasize-lines: 3-5
422
372
:dedent:
423
373
374
+
.. _mcs-logger-settings:
375
+
376
+
Logger Settings
377
+
---------------
378
+
379
+
Chain the `applyToLoggerSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToLoggerSettings(com.mongodb.Block)>`__
380
+
method to modify the logging behavior of the driver.
381
+
382
+
The following table describes the methods you can chain to your
383
+
settings to modify the logging behavior:
384
+
385
+
.. list-table::
386
+
:widths: 40 60
387
+
:header-rows: 1
388
+
389
+
* - Method
390
+
- Description
391
+
392
+
* - ``maxDocumentLength()``
393
+
- Sets the maximum document length, in characters, of a single log
394
+
message.
395
+
396
+
Example
397
+
~~~~~~~
398
+
399
+
This example specifies that the maximum number of characters for a single log
@@ -430,7 +415,7 @@ Chain the `applyToServerSettings() <{+api+}/apidocs/mongodb-driver-core/com/mong
430
415
method to modify the driver's behavior when monitoring each MongoDB
431
416
server.
432
417
433
-
The following table describes all the methods you can chain to your
418
+
The following table describes the methods you can chain to your
434
419
settings to modify the driver's behavior:
435
420
436
421
.. list-table::
@@ -474,6 +459,60 @@ This example specifies the following driver behavior in a MongoDB server:
474
459
:emphasize-lines: 3-5
475
460
:dedent:
476
461
462
+
.. _mcs-socket-settings:
463
+
464
+
Socket Settings
465
+
---------------
466
+
467
+
Chain the `applyToSocketSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToSocketSettings(com.mongodb.Block)>`__
468
+
method to modify the driver's behavior when connecting and communicating
469
+
with your MongoDB server.
470
+
471
+
The following table describes the methods you can chain to your settings
472
+
to modify the driver's behavior:
473
+
474
+
.. list-table::
475
+
:widths: 40 60
476
+
:header-rows: 1
477
+
478
+
* - Method
479
+
- Description
480
+
481
+
* - ``applyConnectionString()``
482
+
- Uses the settings from a ``ConnectionString`` object.
483
+
484
+
* - ``applySettings()``
485
+
- Uses the socket settings specified in a ``SocketSettings`` object.
486
+
487
+
* - ``connectTimeout()``
488
+
- Sets the maximum time to connect to an available socket before throwing
489
+
a timeout exception.
490
+
491
+
* - ``readTimeout()``
492
+
- Sets the maximum time to read to an available socket before throwing a
493
+
timeout exception.
494
+
495
+
* - ``receiveBufferSize()``
496
+
- Sets the socket's buffer size when receiving.
497
+
498
+
* - ``sendBufferSize()``
499
+
- Sets the socket's buffer size when sending.
500
+
501
+
Example
502
+
~~~~~~~
503
+
504
+
This example specifies the following driver behavior in a MongoDB socket:
505
+
506
+
- To connect to an available socket within ``10 SECONDS``
507
+
- To read from an available socket within ``15 SECONDS``
0 commit comments