[CSHARP-2594] SdamLogFilename value is lost sometimes Created: 17/Apr/19  Updated: 27/Oct/23  Resolved: 17/Apr/19

Status: Closed
Project: C# Driver
Component/s: Configuration
Affects Version/s: 2.8.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CSHARP-2580 Add reference docs for SDAM logging Closed

 Description   

One way to reproduce:

var connectionString = "mongodb://localhost/?sdamLogFilename=C:\\sdam.log";
var clientSettings = MongoClientSettings.FromConnectionString(connectionString);
var sdamLogFilename = clientSettings.SdamLogFilename; // assigns null!

Check for others.



 Comments   
Comment by Robert Stam [ 17/Apr/19 ]

I have confirmed with coworkers that this is by design.

Two decisions are interacting for the above code to silently assign null to the sdamLogFilename variable:

  1. It was decided that the SdamLogFilename property of MongoClientSettings would only be configurable in code
  2. The connection string spec says that drivers must ignore any settings that they don't recognize
Comment by Robert Stam [ 17/Apr/19 ]

This might be by design.

We don't currently support sdamLogFilename=xyz.log in the connection string.

So clientSettings.SdamLogFilename returned null simply because nothing has set its value yet.

Generated at Wed Feb 07 21:42:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.