I am using nlog v3 and I cannot figure out the way to do programatically what
<nlog>
<extensions>
<add assembly="NLog.MongoDB" />
</extensions>...
does. I found one answer on old Nlog forums, that could've helped, but it was for v1 and v2 and these classes are no longer there. Anybody knows how to do it in code?
This should do it:
var assembly = Assembly.Load("NLog.MongoDB");
NLog.Config.ConfigurationItemFactory.Default.RegisterItemsFromAssembly(assembly);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With