How does Serilog implemented period for capped collection? See this code:
Log.Logger = new LoggerConfiguration() .WriteTo.MongoDBCapped(
database: database,
restrictedToMinimumLevel: (Serilog.Events.LogEventLevel)logEventLevel,
collectionName: _collectionName,
period: TimeSpan.FromDays(RetainedDays))
Because according to the MongoDB documentation you can not store a document using its "TTL functionality" together with capped collection. So I am assuming: The library keeps somehow track of this inside its code, but I am wondering how: And if it is fast enough.
MongoDB Capped Collection: https://docs.mongodb.org/manual/core/capped-collections/ GitHub MongoDB Sink (target) for Serilog: https://github.com/serilog/serilog-sinks-mongodb
Maybe it would be even easy to write our own Sink with a normal collection together with TTL documents.