How to output to the visual studio 2008 'output' window?

3 messages Options
Embed this post
Permalink
Peeks-2

How to output to the visual studio 2008 'output' window?

Reply Threaded More More options
Print post
Permalink
Hi folks,
   i'm trying to set the output to the visual studio 2008 output window. This is the target window when you do the following in code

System.Diagnostics.WriteLine("blah");

I have the following 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="console" xsi:type="Console" layout="${date:format=HH\:mm\:ss}|${level}|${stacktrace}|${message}" />
    <target name="file" xsi:type="File" fileName="${basedir}/Logs/LolBubs_Errors.log" layout="${date}: ${message}" />
    <target name="eventlog" xsi:type="EventLog" source="NLog" log="Application" layout="${date}: ${message} ${stacktrace}" />
  </targets>
  <rules>
    <!-- Everything to the console for debug mode. -->
    <logger name="*" minlevel="Info" writeTo="console" />
  </rules>
</nlog>

if i set the writeTo to be console .. nothing is outputted.
if i set the writeTo to be file ... it works 100%

this is for asp.net web applications/sites.

can anyone confirm if it's possible and if so, what i'm doing wrong?

i'm also calling the logger.Info("message") method.

cheers!
Jaroslaw Kowalski

Re: How to output to the visual studio 2008 'output' window?

Reply Threaded More More options
Print post
Permalink
Have you tried Debugger target?

http://www.nlog-project.org/target.Debugger.html
Peeks-2

Re: How to output to the visual studio 2008 'output' window?

Reply Threaded More More options
Print post
Permalink
Nope - i didn't think it would make a difference.

and if the Debugger target works.... why wouldn't the other targets not work then?