> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 自動收集損毀傾印

> 在 PlayFab 多人遊戲伺服器 Windows 容器組建上啟用自動損毀傾印收集，以在裝載的遊戲伺服器處理序損毀時擷取迷你傾印。

# 啟用自動損毀傾印收集

本文將說明如何為伺服器啟用自動損毀傾印收集。

<Note>
  此功能僅適用於 Windows 容器伺服器。我們目前沒有適用於 Linux 或 Windows 處理序型伺服器的方法。
</Note>

若要啟用自動損毀傾印收集，您可以使用如下所示的 CreateBuildWithManagedContainer API。若要深入了解 CreateBuildwithManagedContainer，請參閱 [Multiplayer Server - CreateBuild With Managed Container](https://learn.microsoft.com/en-us/rest/api/playfab/multiplayer/multiplayer-server/create-build-with-managed-container)。在 JSON 中，您可以在要求本文中新增名為 "WindowsCrashDumpConfiguration" 的新欄位，以啟用損毀傾印。

```Json theme={null}
    "BuildName": "crashDumpTest",
    "ContainerFlavor": "ManagedWindowsServerCore",
    "MultiplayerServerCountPerVm": 1,
    "Ports": [
        {
            "Name": "PortName",
            "Num": 1243,
            "Protocol": "TCP"
        }
    ],
    "RegionConfigurations": [
        {
            "Region": "EastUs",
            "MaxServers": 1,
            "StandbyServers": 1
        }
    ],
    "StartMultiplayerServerCommand": "C:\\Assets\\CrashingServerExample.exe sizeMiB:10",
    "UseStreamingForAssetDownloads": false,
    "GameAssetReferences": [
        {
            "FileName": "CrashingServerExample_v1_0.zip",
            "MountPath": "C:\\Assets"
        }
    ],
    "VmSize": "Standard_D2_v2",
    "WindowsCrashDumpConfiguration": {
        "IsEnabled": true,
        "DumpType": 0,
        "CustomDumpFlags": 6693
    }
}
```

<Note>
  啟用此功能後，您的 DumpType 和 CustomDumpFlag 值將會放入登錄機碼中。若要深入了解，請閱讀[收集使用者模式傾印](https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps)
</Note>

伺服器損毀並建立記錄後，PlayStream 通知會提供伺服器識別碼。取得伺服器識別碼後，您可以在已封存的伺服器頁面下搜尋它。瀏覽至 Archived servers 頁面，並將您取得的伺服器識別碼貼到搜尋列中。下載受影響伺服器的記錄，您就會看到損毀傾印檔案。若要深入了解，請閱讀[封存和擷取多人遊戲伺服器記錄](/zh-TW/services/playfab/multiplayer/servers/archiving-and-retrieving-multiplayer-server-logs)


## Related topics

- [使用 Game Manager 部署組建](/zh-TW/services/playfab/multiplayer/servers/deploy-using-game-manager.md)
- [CrashDetectedEventPayload](/zh-TW/services/playfab/api-references/events/data-types/crashdetectedeventpayload.md)
- [IXtfConsoleControlClient::GenerateStackDump](/zh-TW/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_generatestackdump.md)
- [GDK 名詞與縮寫詞彙表](/zh-TW/home/glossary.md)
- [套件 (傳統體驗)](/zh-TW/publishing/game-publishing/concepts/packages-overview.md)
