我怎么能输出NLOG东西VS2008的“输出”窗口? [英] How can I output NLog stuff to the vs2008 'output' window?

查看:248
本文介绍了我怎么能输出NLOG东西VS2008的“输出”窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用NLOG登录我的东西。我试图将输出发送到控制台(或colouredconsole)... ...这我希望会去到Visual Studio输出窗口任何ASP.NET网站/应用/ MVC应用程序。

I'm using NLog to log my stuff. I'm trying to send the output to the console (or colouredconsole) ... which I'm hoping would go to the Visual Studio 'OUTPUT' window for any ASP.NET web site/app/mvc app.

这不是。如果我改变目标,以'文件',那么它的工作原理是肯定的。

It's not. If I change the target to 'file' then it works for sure.

能否NLOG输出到输出窗口的Web应用程序?

Can NLog output to the 'output' window for web apps?

推荐答案

您可以使用此配置文件(nlog.config在应用程序路径):

You can use this configuration file (nlog.config in the app path):

<?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>

斯科特

这篇关于我怎么能输出NLOG东西VS2008的“输出”窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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