Closed odalet closed 6 years ago
Hi @odalet, I would like to share my vague understanding on this topic as I was just wondering the same thing :)
So it turns out that if you are planning on using NLog 4.5 on your application as your logging framework of choice, you then must install the Common.Logging.NLog45 adapter which must be avaialable on NuGet. For information on why this is like this see here
The problem with NLog 4.5 or later is the fact that there is no Common.Logging.NLog45 adapter in this repository implemented yet, unfortunately :(
You will have to track the issues and this project to see when this might be done. But judging by the activity of this repository it seems like it may take some time. Hope that information helps.
The idea is to pair NLog 4.a.b
with Commons.Logging.NLog4ab
.
The currently highest available is Commons.Logging.NLog4411
which should be paired with NLog 4.4.11
.
If you plan to use NLog > 4.4.11
however, you will not be able to hook it up with Commons.Logging
.
When reading the documentation, then it says one should just use Common.Logging.NLog41 :
https://github.com/net-commons/common-logging#nlog-quickstart
All versions beyond this version are just means to force push the NLog-version forward. But not required for using with NLog 4.4 or 4.5.
But it is difficult to make use of structured logging (Introduced in NLog 4.5), because the NLogLogger is for some reason using StringFormatFormattedMessage
(Should be removed since NLog is perfectly capable of doing message-formatting since NLog 1.0)
OK, thanks for all your replies. In an ideal world, and assuming NLog respects semantic versioning (I hope it does), Common.Logging.NLog4 should be sufficient for all NLog 4.* versions; app.config's binding redirects would take care of selecting the correct NLog version...
I understand versions of Common Logging > 41 force a higher minimal version of NLog, but I don't really see the point: this places burden on the Common Logging maintainers to provide up to date versions as well as on the consumers if they want a clean up to date Nuget references list.
Maybe the way to go would be to provide Common.Logging.NLog4 as a source package, thus getting rid of version issues.
Btw these are only my own ramblings on these versioning issues. I close the issue.
There is only NLog version 4.0.0.0. So no need for any binding redirects. See link in previous comment about NLog using SemVer.
@snakefoot : I think you forgot the link, but I get it, NLog's assembly is always 4.0.0.0, the Nuget package version changes over time...
Hi, I'm wondering if there are differences (apart from the minimum required NLog version) between all the Common.Logging.NLog* packages?
As of now, I can list (for NLog v4+ and only official Common.Logging 3.4.1 packages):
What's the recommended package if I'm using, say, NLog 4.5.6?