Which is the best viewer for NLog? [closed]

試著忘記壹切 提交于 2019-12-20 10:22:30

问题


Which is the best viewer for NLog?

log2console

sentinel

Other ?


回答1:


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




回答2:


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...)




回答3:


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.



来源:https://stackoverflow.com/questions/6539340/which-is-the-best-viewer-for-nlog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!