问题
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		" 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>
Notes:
- 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.
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