How can I output NLog stuff to the vs2008 'output' window?

前端 未结 1 350
小蘑菇
小蘑菇 2021-01-31 13:50

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

相关标签:
1条回答
  • 2021-01-31 14:19

    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>
    

    -Scott

    0 讨论(0)
提交回复
热议问题