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/logging-and-monitoring/logging.txt
+24-19Lines changed: 24 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -81,9 +81,10 @@ The following example shows how to set up a logger. Select the :guilabel:`Logbac
81
81
:copyable: false
82
82
83
83
...
84
-
12:14:55.853 [main] DEBUG org.mongodb.driver.connection - Opened connection [connectionId{localValue:3, serverValue:3}] to <MongoDB hostname>
85
-
12:14:55.861 [main] DEBUG org.mongodb.driver.protocol.command - Command "find" started on database <database> using a connection with driver-generated ID 3 and server-generated ID 3 to <MongoDB hostname>. The request ID is 5. Command: {"find": "<collection>", "filter": {}, "limit": 1, "singleBatch": true, "$db": "<database>", "lsid": {"id": {"$binary": {"base64": "<_id>", "subType": "04"}}}, "$readPreference": {"mode": "primaryPreferred"}}
86
-
12:14:55.864 [main] DEBUG org.mongodb.driver.protocol.command - Command "find" succeeded in 4.34 ms using a connection with driver-generated ID 3 and server-generated ID 3 to <MongoDB hostname. The request ID is 5. Command reply: {"cursor": {"id": 0, "ns": "<database>.<collection>", "firstBatch": []}, "ok": 1.0, "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1673778535, "i": 1}}, "signature": {"hash": {"$binary": {"base64": "<_id>", "subType": "00"}}, "keyId": 0}}, "operationTime": {"$timestamp": {"t": 1673778535, "i": 1}}}
84
+
12:14:55.833 [main] DEBUG org.mongodb.driver.connection - Checkout started for connection to <MongoDB hostname>
13:21:29.237 [main] DEBUG org.mongodb.driver.protocol.command - Command "find" started on database "test" using a connection with driver-generated ID 3 and server-generated ID 516757 to localhost:27017. The request ID is 5 and the operation ID is 5. Command: {"find": "test", "filter": {}, "limit": 1, "singleBatch": true, "$db": "test", "lsid": {"id": {"$binary": {"base64": "Bw3a3QK7QAGob8VghbJguw==", "subType": "04"}}}}
210
-
13:21:29.244 [main] DEBUG org.mongodb.driver.protocol.command - Command "find" succeeded on database "test" in 8.823416 ms using a connection with driver-generated ID 3 and server-generated ID 516757 to localhost:27017. The request ID is 5 and the operation ID is 5. Command reply: {"cursor": {"firstBatch": [{"_id": {"$oid": "6876d15f70164c1e5a47be02"}, "advance": "$clusterTime"}], "id": 0, "ns": "test.test"}, "ok": 1.0, "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1753129287, "i": 1}}, "signature": {"hash": {"$binary": {"base64": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "subType": "00"}}, "keyId": 0}}, "operationTime": {"$timestamp": {"t": 1753129283, "i": 1}}}
211
-
13:21:29.249 [main] DEBUG org.mongodb.driver.operation - Received batch of 1 documents with cursorId 0 from server localhost:27017
212
-
213
-
.. tabs::
206
+
317 [main] INFO org.mongodb.driver.client - MongoClient with metadata {"driver": {"name": "<driver-name>", "version": "<driver-version>"}, "os": {"type": "<os-type>", "name": "<os-name>", "architecture": "<architecture>", "version": "<os-version>"}, "platform": "<platform-info>"} created with settings <MongoClientSettings>
207
+
345 [cluster-ClusterId{value='<cluster-id>', description='null'}-<MongoDB hostname>] INFO org.mongodb.driver.cluster - Monitor thread successfully connected to server with description ServerDescription{address=<MongoDB hostname>, type=<server-type>, cryptd=false, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=<max-wire-version>, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=<round-trip-nanos>, minRoundTripTimeNanos=<min-round-trip-nanos}
214
208
215
209
.. tab:: Log4j2
216
210
:tabid: Log4j2-binding
@@ -258,7 +252,8 @@ The following example configures the log level to ``INFO``. Select the :guilabel
258
252
:copyable: false
259
253
260
254
...
261
-
255
+
21:19:25.696 [main] INFO org.mongodb.driver.client - MongoClient with metadata {"driver": {"name": "<driver-name>", "version": "<driver-version>"}, "os": {"type": "<os-type>", "name": "<os-name>", "architecture": "<architecture>", "version": "<os-version>"}, "platform": "<platform-info>"} created with settings <MongoClientSettings>
256
+
21:19:25.710 [cluster-ClusterId{value='<cluster-id>', description='null'}-<MongoDB hostname>] INFO org.mongodb.driver.cluster - Monitor thread successfully connected to server with description ServerDescription{address=<MongoDB hostname>, type=<server-type>, cryptd=false, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=<max-wire-version>, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=<round-trip-nanos>, minRoundTripTimeNanos=<min-round-trip-nanos}
262
257
263
258
Logger Names
264
259
------------
@@ -333,7 +328,7 @@ Select the :guilabel:`Logback` or :guilabel:`Log4j2` tab to see the correspondin
@@ -350,8 +345,13 @@ Select the :guilabel:`Logback` or :guilabel:`Log4j2` tab to see the correspondin
350
345
:copyable: false
351
346
352
347
...
353
-
829 [cluster-rtt-ClusterId{value='<some value>', description='null'}-<your connection URI>] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:2, serverValue:<your server value>}] to <your connection uri>
354
-
977 [main] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:7, serverValue:<your server value>}] to <your connection uri>
348
+
255 [main] DEBUG org.mongodb.driver.connection - Connection pool created for <MongoDB hostname> using options <connection-pool-options>
349
+
301 [cluster-ClusterId{value='<cluster-id>', description='null'}-<MongoDB hostname>] DEBUG org.mongodb.driver.connection - Connection pool ready for <MongoDB hostname>
350
+
321 [main] DEBUG org.mongodb.driver.connection - Checkout started for connection to <MongoDB hostname>
@@ -387,8 +387,13 @@ Select the :guilabel:`Logback` or :guilabel:`Log4j2` tab to see the correspondin
387
387
:copyable: false
388
388
389
389
...
390
-
15:40:23.005 [cluster-ClusterId{value='<some value>', description='null'}-<your connection uri>] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:3, serverValue:<your server value>}] to <your connection uri>
391
-
15:40:23.159 [main] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:7, serverValue:<your server value>}] to <your connection uri>
390
+
21:27:17.035 [main] DEBUG org.mongodb.driver.connection - Connection pool created for <MongoDB hostname> using options <connection-pool-options>
391
+
21:27:17.058 [cluster-ClusterId{value='<cluster-id>', description='null'}-<MongoDB hostname>] DEBUG org.mongodb.driver.connection - Connection pool ready for <MongoDB hostname>
392
+
21:27:17.064 [main] DEBUG org.mongodb.driver.connection - Checkout started for connection to <MongoDB hostname>
0 commit comments