This package is an extension to NLog.
NLog.WPF is a simple WPF-control to show NLog-logs. It's heavily inspired by NLog.Windows.Forms and this blog.
Add a namespace to your Window, like this:
xmlns:nlog ="clr-namespace:NLog.WPF;assembly=NLog.WPF"
then add the control
<nlog:NlogListView x:Name="logCtrl" TimeWidth="auto" LoggerNameWidth="0" LevelWidth="auto" ExceptionWidth="auto" MessageWidth="auto" />
or
<nlog:NlogRichTextBox x:Name="logCtrlNlogRichTextBox1"/>
clear NlogRichTextBox
<Button Content="ClearLog" CommandTarget="{Binding ElementName=logCtrlNlogRichTextBox1}" Command="{x:Static nlog:NlogRichTextBox.ClearCommand}" />
To setup NlogViewer as a target, add the following to your Nlog.config.
fix: 1. Constructor display failed 2. Parameters[0] is true => Not Show Log Message
feat:
- fixed some known issues
feat:
- add IsLightTheme Property
- add IsShowLogMessage Function
<extensions>
<add assembly="NLog.WPF" />
</extensions>
<targets>
<target xsi:type="NLog.WPF" name="ctrl" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="ctrl" />
</rules>
dotnet nuget push <packageName> --api-key <apikey> --source https://api.nuget.org/v3/index.json