write to IIS log from an ASP.NET application

前端 未结 4 1528
陌清茗
陌清茗 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:14

    Try Response.AppendToLog(), this writes to the IIS log file. It's good because it doesn't require any additional software. The only downside is that your log file is likely to be huge. I mainly use it for identifying content logged in the IIS log. Eg. Write the user-name when they login, and you can track their session.

提交回复
热议问题