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 either become a Patron to use NServiceBusExtensions. 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 NServiceBusExtensions organization.
Thanks to all the backing developers. Support this project by becoming a patron.
https://nuget.org/packages/NServiceBus.MicrosoftLogging/ https://nuget.org/packages/NServiceBus.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.