Write to a log file in ASP.NET

前端 未结 3 2058
别跟我提以往
别跟我提以往 2020-12-31 17:47

I am writing event data to a log file in an asp.net httphandler by using the File.AppendAllText method. I am concerned with what will happen when multiple requests are rece

3条回答
  •  情书的邮戳
    2020-12-31 18:36

    You can use My.Log to write to log files.

    Edit: If you use the FileLogTraceListener, that listener is thread-safe.

    Doing this also allows you to control and configure the logging through the web.config file.

提交回复
热议问题