コード例 #1
0
        protected override void Append(LoggingEvent[] loggingEvents)
        {
            var factory = new BuildBsonDocumentFactory(_fields);
            IBuildBsonDocument buildBsonDocument = factory.GetBuildBsonDocument();

            var collection = GetCollection();

            collection.InsertManyAsync(loggingEvents.Select(t => buildBsonDocument.Build(t)));
        }
コード例 #2
0
        protected override void Append(LoggingEvent loggingEvent)
        {
            var factory = new BuildBsonDocumentFactory(_fields);
            IBuildBsonDocument buildBsonDocument = factory.GetBuildBsonDocument();
            var document = buildBsonDocument.Build(loggingEvent);

            var collection = GetCollection();

            collection.InsertOne(document);
        }