where does console output go?

H

Hans Kesting

Hi;
When my ASP.NET app is running on IIS, where does the
Console.Out.WriteLine("hi there"); output go?

I don't think it goes anywhere. It definitely doesn't go to the client, as
this
runs on the server. But that server process doesn't have any console to write
to,
so this output is ignored.

If you want to write logging, try log4net http://logging.apache.org/log4net/

Hans Kesting
 
S

Steven Cheng[MSFT]

Hello Dave,

As for the Console, each win32 process has a standard console output, input
and err, you can write data to output. In console application, the console
output is directly displayed. For winform or asp.net application, it is not
displayed, there does have means to redirect console in .NET:

#Redirect I/O to a TextBoxWriter in .NET
http://www.codeguru.com/csharp/csharp/cs_data/streaming/article.php/c11777/

However, for ASP.NET application, I think you may consider other means
according to your actual scenario. Are you wantting to write out some debug
or trace data? If so the System.Diagnostics namespace contains classes that
help perform debug and trace or logging.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Thanks for your reply Dave,

Actually, in .net framework application, those Diagnostics interfaces such
as Debug, Trace object are the expected object for output some tracing
info, you can redirect the output to your prefered output storage such as
database, disk file..... Java console is simply a particular console which
bind to the standard process output.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top