GithubHelp home page GithubHelp logo

nlogviewer's Introduction

NuGet

NlogViewer

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

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" />
  </targets>
  <rules>
    <logger name="*" minlevel="Trace" writeTo="ctrl" />
  </rules>

Nuget

A NuGet-package is available here. It will try to install the control and a sample Nlog.config.

nlogviewer's People

Contributors

erizet avatar fab672000 avatar pavelsamanek avatar sadfsadfasdf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nlogviewer's Issues

How to add two different NlogViewers to same application, having two different targets

Hi, great control by the way! I'm new to it, but through the examples I cannot relate targeting two different NlogViewers. I guess it would be something like:

  <extensions>
    <add assembly="NlogViewer" />
  </extensions>
  
  <targets>
    <target xsi:type="NlogViewer" name="logCtrl1" />
    <target xsi:type="NlogViewer" name="logCtrl2" />
  </targets>
  
  <rules>
    <logger name="*" minlevel="Debug" writeTo="logCtrl1" />
    <logger name="*" minlevel="Trace" writeTo="logCtrl2" />
  </rules>

but I don't know how to configure the WPF control itself to be the target of "logCtrl1" and "logCtrl2"

Lack of license

Right now the terms on which you share your code are not clear.

Pause the receiving of data

It's more a new feature request, I'd like to allow the user to stop the stream of data (e.g. the user already find the line was looking for) .
The change could be in NlogViewer.xaml.cs

`
private bool _isPausing = false;
[Description("Pause the receiving of data"), Category("Data")]
[TypeConverter(typeof(BooleanConverter))]
public bool Pause
{
get { return _isPausing; }
set { _isPausing = value; }
}

`

and in method LogReceived the _isPausing can be checked.

If you'd like I can push a branch with the changes.

License

Hello,

is this open source project? There is no license specified.

Thank you,

Pavel

Silverlight support

Thank you for this library. Ive been pulling my hair to add WPF richtextbox support without full success. Very handy.

Could you add silverlight support to this library?

I dont know where to ask. I dont have your website or your email. Pardon me for asking it here.

Thanks.

Columns

Is there a way to change the columns that are displayed? I was wanting to add the timestamp.

Automatic scroll-to-end

Hi. Very nice control, thanks!

One comment: it was not obvious (to me) at first how to get scroll bars. Some googling revealed it is pretty simple ... simply set the height; e.g. <NLogViewer Height="xxx" ...>. Would be nice to have that in the doc or example.

Now that I have the scrollbar, it would be nice to have the listview scroll to the end. It seems possible but would need modification to the control, I think. I would advocate for scroll-to-end to be the default.

No default values for width properties

Making a simple WPF application, following the readme, and logging text yields an application that looks like this: https://gyazo.com/e7c630a66fe319a8995b58e9f451c5aa

Hovering over areas in the view had a tooltip display for the message, so it seemed like logging worked, but rendering was broke.

After digging through the code and trying to figure out why things weren't working out of the box, I realized the width properties have no default values, so things appear broken when they're really not.

After manually setting widths, everything worked as expected: https://gyazo.com/0ca572ba5ca9252e001695cde0862131

Please add default width values, or update the readme example to mention this, to save others from similar issues when trying NlogViewer.

For example:
<nlogViewer:NlogViewer x:Name="logCtrl" ExceptionWidth = "100" MessageWidth="100" LevelWidth="100" TimeWidth="100" LoggerNameWidth="100"/>

Hide columns

This should have been a request on SO but i do not have enough reputation to ask! Apologies if its already possible. Could you point me in the right direction if it is? My email is [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.