write to IIS log from an ASP.NET application

前端 未结 4 1535
陌清茗
陌清茗 2021-01-04 18:45

I want to have my ASP.NET application write lines to a log somewhere. Does IIS provide any built-in way to log ASP.NET log messages? I was thinking there might be a way to

4条回答
  •  攒了一身酷
    2021-01-04 19:03

    To capture the Debug.Write and Debug.WriteLine use the DebugView from sysinternals.

    http://technet.microsoft.com/en-us/sysinternals/bb896647

    Of course you have to compile with Debug=true or else the functions is not called at all. So the Debug.Write is a good way only for test in real time and debug your application and not a solution to keep log on the errors in general. For the case that you like to save the errors I think that you need to ether use one library of the other user suggestions, or write direct on event viewer your errors.

    ps: For some reason the version 4.78 is not working on my windows xp and I switch back to 4.77

提交回复
热议问题