34

Which is the best viewer for NLog?

log2console

sentinel

Other?

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
Pierre8r
  • 571
  • 1
  • 5
  • 10
  • the best seems like a subjective metric. – roundcrisis Sep 17 '12 at 12:07
  • 2
    I like http://insightextensions.codeplex.com/ much better then those list in your question. – code5 Aug 22 '13 at 11:02
  • @code5 ... is commercial, you should note that. log2console and sentinel are free. – Beachwalker Mar 03 '15 at 22:01
  • @Beachwalker - and your point is? If you want free go for it. ReflectInsight is a more superior product in terms of speed, what it can log in structured format, distributed logging and live logging that can be up and running for years with a minimal memory footprint. The other viewers that where mention are ok for debugging during development but they don't come anywhere close to being enterprise ready, especially in production environments. – code5 Mar 04 '15 at 03:27
  • Try [my solution](https://drive.google.com/open?id=1GFcIlH3aNHVLHU1l0PK6joGNAebMNldV). I decided to develop this program, because log2console constantly hung up when it received a lot of logs. P.S. LogViewer works only over UDP. – Витёк Синёв Feb 05 '19 at 08:40

3 Answers3

15

Although a very old question, the same question has been haunting me this last couple of weeks. Here is my little contribution to the hive-mind:

I found that for a lightweight client or client/server application using a simplistic, lightweight log viewer like log2console with NLogViewer target' filled with additional parameters fields made it both easy to use/setup and customize, while being readable and easy to find the info I looked for.

I used a UDP listener in the log viewer, and the following target definition in my NLog configuration:

<target xsi:type="NLogViewer" name="logviewer" address="udp://localhost:7071" onOverflow="Split">
    <parameter name="Message&#9;&#9;" layout="${message}" />
    <parameter name="Callsite&#9;&#9;" layout="${callsite:includSourcePath=true}"/>
    <parameter name="Exception&#9;" layout="${exception:separator=&#13;&#10;----&#13;&#10;:innerExceptionSeparator=&#13;&#10;-- -- -- -- --&#13;&#10;:maxInnerExceptionLevel=5:format=Message,Type,StackTrace:innerFormat=Message,Type,StackTrace}" />
    <parameter name="StackTrace&#9;" layout="${newline}&#9;${stacktrace_custom}" />
</target>

Notes:

  1. The &#9; is tab, which helps make it a bit more readable.
  2. The &#13;&#10; is newline, since I couldn't use ${newline} in a layout renderer's parameter (an NLog limitation).
  3. In my example I use a very detailed layout, you can of course edit it however you like, use the $exception layout renderer doc page for reference.

Hope someone finds this helpful

Lockszmith
  • 2,173
  • 1
  • 29
  • 43
  • 2
    Log2Console now supports NLog explicitly. See [instructions](https://github.com/pmorton/Log2Console/blob/master/src/TestNLog/NLog.config) – Jared Beach Jan 19 '18 at 17:55
  • 1
    I [had to use udp4://](http://nlog-forum.1685105.n2.nabble.com/cant-run-NLog-Log2Console-td5674483.html) to get it to work, and the [more basic configuration](https://github.com/pmorton/Log2Console/blob/master/src/TestNLog/NLog.config) suggested by @JaredBeach. – SharpC May 08 '19 at 09:50
13

I quite like Log4View:

http://www.log4view.com/log4view/

(It is a commercial tool, though. I think they should pay me for making advertisement for them, but sadly they do not...)

mpeac
  • 720
  • 8
  • 27
Stefan Egli
  • 17,398
  • 3
  • 54
  • 75
1

Please check out nlogcruncher very simple to use and free.

<target name="network" xsi:type="Network" address="udp://127.0.0.2:4000"
    layout="${date:format=HH\:MM\:ss.fff} | ${logger} | ${level} | ${message}"/>

There is also NLog Viewer but it only as a trial.

Jethro
  • 5,896
  • 3
  • 23
  • 24
  • Can you get exception and stacktrace information here? I am struggling with Sentinel and Log2Console apps, can only get the message part through. – angularsen Apr 03 '12 at 09:16
  • Just use the following layout to get exception and stack trace. layout="${longdate} ${message} ${exception:format=tostring}" – Jethro May 02 '12 at 14:36
  • It's looking like this isn't working for me any longer on Windows 10 - latest. Any ideas if this is still supported or working? – mochsner Jul 29 '21 at 20:52