diff options
author | Samy Lanka <samy.lanka@mongodb.com> | 2018-09-12 16:08:54 -0400 |
---|---|---|
committer | Samy Lanka <samy.lanka@mongodb.com> | 2018-09-13 16:36:48 -0400 |
commit | bd38c69f5e6dc3136d20505d49f034c0927bf3e2 (patch) | |
tree | 236c1771bcc404cd0058a1057e369bf5b3c2bc80 /src/mongo/shell/mongo.js | |
parent | 022c7d50ac5f7f62fd4e91df513baa56d011fc80 (diff) | |
download | mongo-bd38c69f5e6dc3136d20505d49f034c0927bf3e2.tar.gz |
SERVER-36726 Log SessionID when we start a session in the shell and Log TxnNumber when we start a transaction
Diffstat (limited to 'src/mongo/shell/mongo.js')
-rw-r--r-- | src/mongo/shell/mongo.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/shell/mongo.js b/src/mongo/shell/mongo.js index 416416d8b3f..4db8924a8ec 100644 --- a/src/mongo/shell/mongo.js +++ b/src/mongo/shell/mongo.js @@ -441,7 +441,15 @@ Mongo.prototype.startSession = function startSession(options = {}) { if (!options.hasOwnProperty("retryWrites") && this.hasOwnProperty("_retryWrites")) { options.retryWrites = this._retryWrites; } - return new DriverSession(this, options); + const newDriverSession = new DriverSession(this, options); + + // Only log this message if we are running a test + if (typeof TestData === "object" && TestData.testName) { + jsTest.log("New session started with sessionID: " + + tojson(newDriverSession.getSessionId())); + } + + return newDriverSession; }; Mongo.prototype._getDefaultSession = function getDefaultSession() { |