> ## 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 Multiplayer Servers の 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 の値がレジストリ キーに設定されます。詳細については、[Collecting User mode dumps](https://learn.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps) を参照してください。
</Note>

サーバーがクラッシュしてログが作成されると、PlayStream 通知でサーバー ID が通知されます。サーバー ID を取得したら、アーカイブされたサーバー ページで検索できます。アーカイブされたサーバー ページに移動し、検索バーに与えられたサーバー ID を貼り付けてください。影響を受けたサーバーのログをダウンロードすると、クラッシュ ダンプ ファイルが見えます。詳細については、[マルチプレイヤー サーバー ログのアーカイブと取得](/services/playfab/multiplayer/servers/archiving-and-retrieving-multiplayer-server-logs) を参照してください。
