NLog.WPF 1.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package NLog.WPF --version 1.2.2                
NuGet\Install-Package NLog.WPF -Version 1.2.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NLog.WPF" Version="1.2.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NLog.WPF --version 1.2.2                
#r "nuget: NLog.WPF, 1.2.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NLog.WPF as a Cake Addin
#addin nuget:?package=NLog.WPF&version=1.2.2

// Install NLog.WPF as a Cake Tool
#tool nuget:?package=NLog.WPF&version=1.2.2                

NLog.WPF

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.

How to use?

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.

  <extensions>
    <add assembly="NLog.WPF" />
  </extensions>
  <targets>
    <target xsi:type="NLog.WPF" name="ctrl" />
  </targets>
  <rules>
    <logger name="*" minlevel="Trace" writeTo="ctrl" />
  </rules>

publish packget

dotnet nuget push <packageName> --api-key <apikey> --source https://api.nuget.org/v3/index.json
Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0-windows7.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.6 188 4/25/2024
1.2.5 205 1/24/2024
1.2.4 207 8/10/2023
1.2.3 146 8/9/2023
1.2.2 177 7/20/2023
1.2.1 181 7/20/2023