Extend NLog with targets for Windows Forms applications. For example: writing to a richtextbox or raising alert popups.
$ dotnet add package NLog.Windows.FormsThis package provides NLog Targets that redirect logging output to Windows Forms:
See list
Install the NLog.Windows.Forms NuGet package and register the extension-assembly:
NLog will only recognize the extensions when loading from NLog.config-file, by adding the extension to NLog.config-file:
<!-- enable NLog.Windows.Forms targets and layoutrenderers -->
<extensions>
<add assembly="NLog.Windows.Forms"/>
</extensions>
Alternative register from code using fluent configuration API:
NLog.LogManager.Setup().RegisterWindowsForms();BSD