Visual Studio 所收集的系統產生記錄檔System-generated logs collected by Visual Studio

Visual Studio 會透過 Visual Studio 客戶經驗改進計畫收集系統產生的記錄檔來修正問題,並改善產品的品質。Visual Studio collects system-generated logs to fix problems and improve the quality of the product through the Visual Studio Customer Experience Improvement Program. 本文提供我們所收集資料類型和如何使用它的一些資訊。This article provides some information about the types of data we collect and how we use it. 它也提供有關延伸模組作者如何避免意外洩漏個人或機密資訊的祕訣。It also provides tips on how extension authors can avoid inadvertent disclosure of personal or sensitive information.

收集的資料類型Types of collected data

Visual Studio 會收集系統針對損毀、無回應、UI 無回應,和高 CPU 或記憶體使用量而產生的記錄檔。Visual Studio collects system-generated logs for crashes, hangs, UI unresponsiveness, and high CPU or memory usage. 我們也會收集在產品安裝或使用期間遇到之錯誤的相關資訊。We also collect information about errors encountered during product installation or usage. 收集的資料會根據錯誤而異,而且可能包括堆疊追蹤、記憶體傾印,以及例外狀況資訊:The collected data varies based on the error, and may include stack traces, memory dumps, and exception information:

  • 針對高 CPU 使用量和無回應,會收集相關 Visual Studio 執行緒的堆疊追蹤。For high CPU usage and unresponsiveness, stack traces of relevant Visual Studio threads are collected.

  • 針對部分執行緒的堆疊追蹤不足以判斷問題根本原因的情況,例如當機、無回應或高記憶體使用量,我們會收集記憶體「傾印」。For cases where stack traces of some threads aren't enough to determine the root cause of the issue, for example, crashes, hangs or high memory usage, we collect a memory dump. 傾印代表在發生錯誤時的處理序狀態。The dump represents the state of the process when the error occurred.

  • 針對非預期的錯誤情況,例如,嘗試寫入至磁碟上的檔案時發生例外狀況,我們會收集例外狀況的相關資訊。For unexpected error conditions, for example, an exception while trying to write to a file on disk, we collect information about the exception. 資訊包括例外狀況的名稱、發生例外狀況之執行緒的堆疊追蹤、與例外狀況建立關聯的訊息,以及與特定例外狀況相關的其他資訊。The information includes the name of the exception, the stack trace of the thread where the exception occurred, the message associated with the exception, and other information relevant to the specific exception.

    下列收集資料範例會顯示例外狀況名稱、堆疊追蹤和例外狀況訊息:The following example of collected data shows an exception name, stack trace, and exception message:

    "Reserved.DataModel.Fault.Exception.TypeString": "System.IO.IOException",
    "Reserved.DataModel.Fault.Exception.StackTrace": "System.IO.__Error.WinIOError(Int32,String)\r\n
    "Reserved.DataModel.Fault.Exception.Message": " The process cannot access the file 'C:\\Users\\[UserName]\\AppData\\Local\\Microsoft\\VisualStudio\\Packages\\_Channels\\4CB340F5\\channelManifest.json' because it is being used by another process."

我們如何使用系統產生的記錄檔How we use system-generated logs

判斷錯誤根本原因的工作流程,會視錯誤類型和其嚴重性而有所不同。The workflow to determine the root cause of an error varies depending on the type of error and its severity.

錯誤分類Error classification

根據記錄檔,錯誤會分類並計算,以排列調查的優先順序。Based on the logs, errors are classified and counted to prioritize their investigation. 例如,我們可能會發現在產品版本 <x> 的 "System.IO.FileStream.Init" 已發生 500 次 "System.IO.__Error.WinIOError",而且在該版本中有最高的發生率。For example, we may discover that “System.IO.__Error.WinIOError” at “System.IO.FileStream.Init” has occurred 500 times in version <x> of the product, and has the highest rate of occurrence in that version.

追蹤用的工作項目Work items for tracking

對於個別已排列優先順序的錯誤,已建立工作項目並指派給工程師進行調查。Work items for individual, prioritized errors are created and assigned to engineers for investigation. 這些工作項目通常包含分類、優先順序和與錯誤類型相關的診斷資訊。These work items typically contain the classification, priority, and diagnostic information relevant to the type of error. 這項資訊衍生自已收集到之系統針對錯誤所產生的記錄檔。This information is derived from the collected system-generated logs for the error. 例如,損毀的工作項目可能包含發生損毀處的堆疊追蹤。For example, a work item for a crash might contain the stack trace where the crash is occurring.

錯誤調查Error investigation

工程師會使用工作項目中可用的資訊來判斷錯誤的根本原因。Engineers use the information available in a work item to determine the root cause of an error. 在某些情況下,他們需要比出現在工作項目中更多的資訊,在此情況下他們會參考已收集到的原始系統產生記錄檔。In some cases, they need more information than what's present in the work item, in which case they refer to the original system-generated log that was collected. 例如,工程師可能會檢查記憶體傾印以了解產品損毀。For example, an engineer might inspect a memory dump to understand a product crash.

延伸模組作者的祕訣Tips for extension authors

延伸模組作者應該限制個人資訊的曝光,方法是不以其模組、類型和方法的名義來使用個人或其他機密資訊。Extension authors should limit exposure of personal information by not using personal or other sensitive information in the names of their modules, types, and methods. 如果損毀或發生類似的錯誤狀況並在堆疊上具有該代碼,則會收集該資訊成為系統產生的記錄檔的一部分。If a crash or similar error condition occurs with that code on the stack, that information gets collected as part of the system-generated logs.

選擇不使用資料收集Opt out of data collection

了解我們所收集的資料和其存取和保留之條件約束的用途之後,我們建議您針對 Visual Studio 和 Windows 使用預設的隱私權設定。Given the purpose of the data we collect and the constraints on its access and retention, we recommend that you use the default privacy settings for Visual Studio and Windows. 不過,您可以選擇退出 Visual Studio 經驗改進計畫。However, you can opt out of the Visual Studio Experience Improvement Program. 若要選擇退出所有計畫的系統產生記錄檔收集,請參閱 Windows 10 中的診斷、意見反應與隱私權To opt out of system-generated log collection for all programs, see Diagnostics, feedback, and privacy in Windows 10. 選項可能會根據您所使用的 Windows 版本而異。Options may vary depending on the version of Windows you're using.

另請參閱See also