write to IIS log from an ASP.NET application

前端 未结 4 1568
陌清茗
陌清茗 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条回答
  •  猫巷女王i
    2021-01-04 19:21

    as i know Debug.WriteLine writes to the debug output. You can see it in your debugger and save it from there. It does not write a log file.. Debug Class

    1. Debug Class member's are Conditional Attritubte See this Answer for explanation

    you can try ELMAH ,

    is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.

    or you can try Log4Net

提交回复
热议问题