title: Serilog to MongoDB Atlas
body: <p>I am trying to get Serilog to log messages to a collection in a MongoDB Atlas DB, in a .Net Core API.</p>
  
  <p>I need to set the connection string in appsettings.json so as to make it configurable. I am doing so like so</p>
  
  <pre><code>"Serilog": {
      "Using": [ "Serilog.Sinks.MongoDB" ],
      "MinimumLevel": {
        "Default": "Information",
        "Override": {
          "Microsoft": "Error",
          "System": "Warning"
        }
      },
      "WriteTo": [
        {
          "Name": "MongoDB",
          "Args": {
            "databaseUrl": "mongodb://&lt;user&gt;:&lt;password&gt;@&lt;AtlasServer&gt;:27017/logs",
            "collectionName": "log"
  
          }
        }
      ]
    }
  </code></pre>
  
  <p>The above does not log successfully. However, if I point it at a local instance of MongoDB, and use the same method/connection string format, then it logs.</p>
  
  <p>I went through all of the steps to create the collection in MongoDB Atlas, created the collection, user and white listed the necessary IP.</p>
  
  <p>Any ideas as to what I am doing wrong here?</p>