In a J2EE application (like one running in WebSphere), when I use System.out.println()
, my text goes to standard out, which is mapped to a file by the WebSphere admin console.
In an ASP.NET application (like one running in IIS), where does the output of Console.WriteLine()
go? The IIS process must have a stdin, stdout and stderr; but is stdout mapped to the Windows version of /dev/null or am I missing a key concept here?
I'm not asking if I should log there (I use log4net), but where does the output go? My best info came from this discussion where they say Console.SetOut()
can change the TextWriter
, but it still didn't answer the question on what the initial value of the Console is, or how to set it in config/outside of runtime code.
Console. writeline() goes to a console window: the black command / dos prompt.
It goes to the console (standard output) or to the stream that the console is set to.
WriteLine() does not write to any window in Visual Studio. I guess it will only write to the application console if your application creates a console in the first place, i.e. if it is a console application. You could prefix your message with a string, e.g. ">>>" and use VSColorOutpu to highlight such lines.
The console window is unchanged. Press F11 . Visual Studio calls the Console.
If you use System.Diagnostics.Debug.WriteLine(...)
instead of Console.WriteLine()
, then you can see the results in the Output window of Visual Studio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With