简体   繁体   English

IIS WebServer输出日志和C#debug.print

[英]IIS WebServer output log and C# debug.print

System.Diagnostics.Debug.Print("[fillmake] : 1\n");

Upper code display message at output window from visual studio .net IDE. 在visual studio .net IDE的输出窗口显示上层代码消息。

After I make publish web site and deploy at IIS web server. 在我发布网站并在IIS Web服务器上部署之后。
I don't see any message output at IIS web server. 我在IIS Web服务器上看不到任何消息输出。

Let me know is there any things wrong. 让我知道有什么不对劲。

How could I know output message from IIS web server. 我如何知道来自IIS Web服务器的输出消息。

you should use a proper logging framework not simply the Debug Output window of Visual Studio. 您应该使用正确的日志框架,而不仅仅是Visual Studio的“调试输出”窗口。

you can do this by including and using Log4Net or NLog or any other .NET enabled logging framework, you could easily get it up and running in minutes and have your logging saved to text file, windows event log, database, sent to you via email etc... 您可以通过包含和使用Log4Net或NLog或任何其他支持.NET的日志记录框架来完成此操作,您可以在几分钟内轻松启动并运行日志并将日志记录保存到文本文件,Windows事件日志,数据库,通过电子邮件发送给您等等...

you could also use other TraceListeners of System.Diagnostics but in my experience Log4Net is way easier and powerful... personal opinion and based on what I have seen ;-) 你也可以使用System.Diagnostics的其他TraceListeners,但根据我的经验,Log4Net更简单,更强大......个人意见和基于我所看到的;-)

Edit: 编辑:

if you do not want to include any external reference in your project have a look at what the .NET framework itself offers to you already, read this one: TraceListener Class 如果您不想在项目中包含任何外部引用,请查看.NET框架本身为您提供的内容,请阅读以下内容: TraceListener类

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM