However, I was very disappointed at how unintuitive it was to get wire up a custom logger!
You need to take several steps to make the official NuGet server write to something like NLog:
- Create a log wrapper.
- Implement NuGet.Server.Logging.ILogger.
- Implement NuGet.ILogger...
- ...which also makes you implement NuGet.IFileConflictResolver!
- Implement your own NuGet.Server.IServiceResolver
- When instantiating ServerPackageRepository...
- ...pass in the ILogger...
- ...AND set the Logger property!
Still confused? Pull the code here, or take a look below!