Skip to content

MongoDB provider for Microsoft's logging for .NET Core class libaries and console applications

Notifications You must be signed in to change notification settings

night-king/MongoDB.Logging

Repository files navigation

MongoDB.Logging

MongoDB provider for Microsoft's logging for .NET Core class libaries and console applications

1.add config

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
});

2.usage

 _logger.LogWarning("start mongodb logging.");

3.test

MongoDB

About

MongoDB provider for Microsoft's logging for .NET Core class libaries and console applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages