我有一個ASP.NET網站。我正在寫日誌文件,以獲得頁面的總時間跨度。寫日誌txt文件會影響我的程序的性能嗎?我在OnUnload
這類事件中記錄了這一點。將日誌寫入文本文件會影響網站的性能嗎?
string logString = string.Format("The total time span for the '{0}' is {1}ms",
_page,
span.TotalMilliseconds);
WriteLog(logString);
日誌摘錄:
8/6/2013 05:38:27]:The total time span for the 'Assign' is 3121.1785ms
[8/6/2013 05:38:27]:The total time span for the 'Assign' is 5.0002ms
[8/6/2013 05:38:27]:The total time span for the 'Assign' is 5.0003ms
[8/6/2013 05:38:27]:The total time span for the 'Assign' is 4.0002ms
[8/6/2013 05:38:27]:The total time span for the 'Assign' is 5.0003ms
[8/6/2013 05:38:27]:The total time span for the 'Assign' is 6.0004ms
多少個併發用戶,你期待嗎?可能不是少數用戶的問題,但也有少數數十萬可能會對你的應用產生負面影響,這是你可以從IIS日誌中獲得的東西嗎?(爲什麼重新發明輪子,如果你不需要) – Tim
只有一些用戶,但我在代碼中看到日誌寫了好幾次在第二個 – JIKKU
我已經在我的問題上面粘貼了日誌 – JIKKU