ChangemakerStudios / serilog-sinks-mongodb

A sink for Serilog that writes events to MongoDB
Apache License 2.0
90 stars 51 forks source link

support mongo db password #56

Closed behroozbc closed 3 years ago

behroozbc commented 3 years ago

hi I use this connection string have password and dont work

{
        "Name": "MongoDB",
        "Args": {
          "databaseUrl": "mongodb://username:password@ip:port/dbName",
          "collectionName": "logs",
          "cappedMaxSizeMb": "1024",
          "cappedMaxDocuments": "50000"
        }
}
Jaben commented 3 years ago

Could you try again with latest v5.0-dev? Thanks

behroozbc commented 3 years ago

hi @Jaben I fix this in version 4 thanks for helping but how I fix this ? change database url to like this "databaseUrl": "mongodb://username:password@ip:port/dbName?authSource=admin", I think add this to document is good

behroozbc commented 3 years ago

I make this https://github.com/serilog/serilog-sinks-mongodb/pull/62

pachecoder commented 3 years ago

hi @Jaben I fix this in version 4 thanks for helping but how I fix this ? change database url to like this "databaseUrl": "mongodb://username:password@ip:port/dbName?authSource=admin", I think add this to document is good

Actually i was looking for this solution. Thanks.

Jaben commented 3 years ago

The example is in the docs -- thanks. Closing this issue!