NLog.Mongo
NLog.Mongo copied to clipboard
MongoTarget/GetConnectionString method .net standart support
GetConnectionString method now supports for .net standart.
Think it is a much better idea to make use of NLog Layout, and then just use ${configsetting}
. Then you can skip the dependency-hell.
Example NLog.config:
<target xsi:type="Mongo" connectionString="${configsetting:item=ConnectionStrings.MongoDb}" />
Example appsettings.json:
{
"ConnectionStrings": {
"MongoDb": "mongodb://localhost/Logging"
}
}
See also: https://github.com/NLog/NLog/wiki/ConfigSetting-Layout-Renderer