One of thecoolest feature of Mongo is the concept of Capped Collection, or “fixed size” collection. They are based ona FIFO queue where the first record to be discharded is the first inserted, andthis is exceptional to create a log-collection that automatically purge all oldlogs without any user intervention.
To be ableto automatically enable this feature on the Log4Net Mongo appender you need to do a little modification to thecode, this is because the original code simply gets a reference to thecollection with this code.
CODE:
connection = MongoServer.Create(mongoConnectionString.ToString());
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/301743/viewspace-731251/ ,如需转载,请注明出处,否则将追究法律责任。