public static BuildBsonDocument ( log4net.Core.LoggingEvent loggingEvent ) : BsonDocument | ||
loggingEvent | log4net.Core.LoggingEvent | |
return | BsonDocument |
private BsonDocument BuildBsonDocument(LoggingEvent log) { if (_fields.Count == 0) { return(BackwardCompatibility.BuildBsonDocument(log)); } var doc = new BsonDocument(); foreach (MongoAppenderFileld field in _fields) { object value = field.Layout.Format(log); BsonValue bsonValue = BsonValue.Create(value); doc.Add(field.Name, bsonValue); } return(doc); }