MongoDB provider for Microsoft's logging for .NET Core class libaries and console applications
log.AddConsole(); //Add Console Logging
log.AddMongoDB((option) =>{ //Add MongoDB Logging
var settings = config.GetSection("Logging").GetSection("MongoDB");
option.Connstr = settings["Conn"];//connection string
option.Database = settings["Database"];//database's name
option.Collection = settings["Collection"];//collection's name
});
_logger.LogWarning("start mongodb logging.");