我怎样才能输出NLog的东西到vs2008'输出'窗口?

我正在使用NLoglogging我的东西。 我试图将输出发送到控制台(或colouredconsole)…我希望会去任何ASP.NET网站/应用程序/ MVC应用程序的Visual Studio的“OUTPUT”窗口。

不是。 如果我将目标更改为“文件”,那么它肯定有效。

NLog可以输出到Web应用程序的“输出”窗口吗?

您可以使用此configuration文件(应用程序path中的nlog.config):

<?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <targets> <target name="debugger" xsi:type="Debugger" layout="${logger}::${message}"/> </targets> <rules> <logger name="*" minlevel="Trace" writeTo="debugger" /> </rules> </nlog> 

斯科特