Skip to content

NlogViewer is a simple WPF-control to show NLog-logs.

License

Notifications You must be signed in to change notification settings

juergs/NlogViewer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NlogViewer

NlogViewer is a simple WPF-control to show NLog-logs. It's heavily inspired by this blog.

Forked from erizet/NlogViewer

How to use?

Add a namespace to your Window, like this:

    xmlns:nlog ="clr-namespace:NlogViewer;assembly=NlogViewer"

then add the control.

    <nlog:NlogViewer x:Name="logCtrl" /> 

To setup NlogViewer as a target, add the following to your Nlog.config.

  <extensions>
    <add assembly="NlogViewer" />
  </extensions>
  <targets>
    <target xsi:type="NlogViewer"
            name="ctrl"
            autoScroll="true"
            maxLines="100"
            lastSelect="true" />
  </targets>
  <rules>
    <logger name="*" minlevel="Trace" writeTo="ctrl" />
  </rules>

Configuration Syntax

<target xsi:type="NlogViewer"
        name="String"
        autoScroll="Boolean"
        maxLines="Integer"
        lastSelect="Boolean" />

Parameters

General Options

  • name - Name of the target.
  • autoScroll - Indicates whether scroll bar will be moved automatically to show most recent log entries. (default true)
  • maxLines - Maximum number of lines control will store.
    After exceeding the maximum number, first line will be deleted. (default 50)
  • lastSelect - Automatically select most recent log entries. (dafault true)

About

NlogViewer is a simple WPF-control to show NLog-logs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 97.1%
  • PowerShell 2.9%