哪个是NLog的最佳查看器? [英] Which is the best viewer for NLog?

查看:342
本文介绍了哪个是NLog的最佳查看器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪个是NLog的最佳查看器?

Which is the best viewer for NLog?

log2控制台

前哨

其他?

推荐答案

尽管这是一个非常古老的问题,但最近两个星期一直困扰着我.这是我对蜂巢思想的一点贡献:

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:

我发现,对于使用诸如 log2console NLogViewer目标'使用/设置和自定义,同时易于阅读并轻松找到我想要的信息.

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.

我在日志查看器中使用了UDP侦听器,并在NLog配置中使用了以下目标定义:

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>

注意:

  1. &#9;是选项卡,有助于使其更具可读性.
  2. &#13;&#10;是换行符,因为我无法在布局渲染器的参数(NLog限制)中使用$ {newline}.
  3. 在我的示例中,我使用了非常详细的布局,您当然可以编辑它,但是可以使用 $ exception布局渲染器文档页面供参考.
  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.

希望有人发现这有帮助

这篇关于哪个是NLog的最佳查看器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆