Add support for NServiceBus to log to Microsoft.Extensions.Logging.
See Milestones for release notes.
Already a Patron? skip past this section
It is expected that all developers become a Patron to use NServiceBus Community Extensions. Go to licensing FAQ
Support this project by becoming a Sponsor. The company avatar will show up here with a website link. The avatar will also be added to all GitHub repositories under the NServiceBusCommunity organization.
Thanks to all the backing developers. Support this project by becoming a patron.
https://nuget.org/packages/NServiceBus.Community.MicrosoftLogging/ https://nuget.org/packages/NServiceBus.Community.MicrosoftLogging.Hosting
snippet: MsLoggingInCode
As LoggerFactory implements IDisposable it must be disposed of after stopping the NServiceBus endpoint. The process for doing this will depend on how the endpoint is being hosted.
Disposing the LoggerFactory is done by the underlying infrastructure.
snippet: MsLoggingInGenericHost
Note: UseMicrosoftLogFactoryLogger requires adding NServiceBus.MicrosoftLogging.Hosting as a package dependency.
When hosting in a windows service LoggerFactory should be disposed of as part of the ServiceBase.OnStop execution.
snippet: MsLoggingInService
Abstract designed by Neha Shinde from The Noun Project.