哪个是NLog的最佳查看器? [英] Which is the best viewer for NLog?
问题描述
哪个是NLog的最佳查看器?
Which is the best viewer for NLog?
其他?
推荐答案
尽管这是一个非常古老的问题,但最近两个星期一直困扰着我.这是我对蜂巢思想的一点贡献:
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		" layout="${message}" />
<parameter name="Callsite		" layout="${callsite:includSourcePath=true}"/>
<parameter name="Exception	" layout="${exception:separator= ---- :innerExceptionSeparator= -- -- -- -- -- :maxInnerExceptionLevel=5:format=Message,Type,StackTrace:innerFormat=Message,Type,StackTrace}" />
<parameter name="StackTrace	" layout="${newline}	${stacktrace_custom}" />
</target>
注意:
-
	
是选项卡,有助于使其更具可读性. -
是换行符,因为我无法在布局渲染器的参数(NLog限制)中使用$ {newline}. - 在我的示例中,我使用了非常详细的布局,您当然可以编辑它,但是可以使用 $ exception布局渲染器文档页面供参考.
- The
	
is tab, which helps make it a bit more readable. - The
is newline, since I couldn't use ${newline} in a layout renderer's parameter (an NLog limitation). - 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屋!