ChangemakerStudios / serilog-sinks-mongodb

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

Capped option not set on new collection #68

Closed jwillmer closed 2 years ago

jwillmer commented 2 years ago

I'm not able to get a mongo collection with the capped option using the config example from the README.

Below is my configuration:

...
        "WriteTo": [
            {
                "Name": "MongoDB",
                "Args": {
                    "databaseUrl": "mongodb://localhost:27017/site-monitor",
                    "collectionName": "monitoring.logs",
                    "restrictedToMinimumLevel": "Warning",
                    "cappedMaxSizeMb": "50",
                    "cappedMaxDocuments": "1000"
                }
            }
...

Do I miss something or is there a way to debug?

jwillmer commented 2 years ago

@Jaben can U comment on it?

Jaben commented 2 years ago

@Jaben can U comment on it?

It's fixed in v5.1.2 (latest).

wuzhenda commented 2 years ago

the max value of the two variable?

"cappedMaxSizeMb"  
"cappedMaxDocuments"