1. 拡張xConnectログ

HTTP要求のログ記録を構成する

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

拡張xConnectログでは、xConnectへのHTTP要求と応答を追跡できます。デフォルトでは無効になっています。

HTTP要求のログ記録を有効にする

HTTPリクエストのログ記録を有効にするには:

  • ファイルの名前を\App_Data\Config\Sitecore\CoreServices\sc.XConnect.RequestLogging.Web.Host.xmlに変更して、ファイル\App_Data\Config\Sitecore\CoreServices\sc.XConnect.RequestLogging.Web.Host.xml.disabledを有効にします。

HTTP要求ログの出力例

ログ出力には、リクエスト (メソッド、URI、HTTPヘッダー、リクエストコンテンツ) とレスポンス (URI、ステータスコード、HTTPヘッダー、コンテンツ) が含まれます。要求と応答をIdフィールドで照合できます。

2021-06-03 14:28:35.167 +03:00 [Verbose] Sending HTTP request Http trace 
{ 
  "Id": 13621, 
  "HttpMethod": { 
    "Method": "POST" 
  }, 
  "Uri": "https://xcp_xconnect/odata/Contacts(44f965ad-28dd-4095-91b6-69e77e696daa)/Interactions", 
  "HeadersInfo": [ 
    { 
      "Key": "Host", 
      "Value": [ 
        "xcp_xconnect" 
      ] 
    }, 
    { 
      "Key": "OData-Version", 
      "Value": [ 
        "4.0" 
      ] 
    }, 
    { 
      "Key": "Accept", 
      "Value": [ 
        "application/json; odata.metadata.context=false" 
      ] 
    }, 
    { 
      "Key": "Content-Type", 
      "Value": [ 
        "application/json; charset=utf-8; odata.metadata.context=false" 
      ] 
    }, 
    { 
      "Key": "Content-Length", 
      "Value": [ 
        "643" 
      ] 
    } 
  ], 
  "Content": "{\"ChannelId\":\"7886e1f5-b85c-484b-bfee-0cb3678dbf0a\",\"StartDateTime\":\"2021-06-03T11:49:14.5869922Z\",\"EndDateTime\":\"2021-06-03T11:49:44.5869922Z\",\"Duration\":\"PT30S\",\"Events\":[{\"@odata.type\":\"#Sitecore.XConnect.Collection.Model.PageViewEvent\",\"CustomValues\":[],\"DefinitionId\":\"9326cb1e-cec8-48f2-9a3e-91c7dbb2166c\",\"ItemId\":\"110d559f-dea5-42ea-9c1c-8a5df7e70ef9\",\"Id\":\"e61bcbad-e464-4e60-afce-0c7004fd20c0\",\"Text\":\"Parent Event: 9326cb1ecec848f29a3e91c7dbb2166c\",\"Timestamp\":\"2021-06-03T11:49:14.5869922Z\",\"Duration\":\"PT30S\",\"ItemLanguage\":\"ja-JP\",\"ItemVersion\":1}],\"UserAgent\":\"abc4f918-b686-4e1e-9c2e-dfa4cbfd1a69\",\"Contact\":{\"@odata.id\":\"$2\"}}" 
} 
 
2021-06-03 14:28:35.167 +03:00 [Verbose] Received HTTP response Http trace 
{ 
  "Id": 13621, 
  "Uri": "https://xcp_xconnect/odata/Contacts(44f965ad-28dd-4095-91b6-69e77e696daa)/Interactions", 
  "StatusCode": 200, 
  "Duration": "00:00:00.0002137", 
  "HeadersInfo": [ 
    { 
      "Key": "Content-Type", 
      "Value": [ 
        "application/json" 
      ] 
    } 
  ], 
  "Content": null 
} 

HTTP要求ログのログ詳細を変更する

HTTPリクエストのログ詳細を変更することができます。次のいずれかの値を選択できます。

  • OnlyRequest(ヘッダーとコンテンツなしで要求と応答をログに記録します)。

    2021-06-03 17:05:10.456 +03:00 [Verbose] Sending HTTP request Http trace 
    { 
      "Id": 4, 
      "HttpMethod": { 
        "Method": "GET" 
      }, 
      "Uri": "https://xcp_xconnect:443/odata/Contacts?%24filter=Id+eq+4b1e26d2-7988-0000-0000-062609cf16cb&%24expand=Identifiers,MergeInfo,ConsentInformation", 
      "HeadersInfo": null, 
      "Content": null 
    } 
     
    2021-06-03 17:05:10.460 +03:00 [Verbose] Received HTTP response Http trace 
    { 
      "Id": 4, 
      "Uri": "https://xcp_xconnect:443/odata/Contacts?%24filter=Id+eq+4b1e26d2-7988-0000-0000-062609cf16cb&%24expand=Identifiers,MergeInfo,ConsentInformation", 
      "StatusCode": 200, 
      "Duration": "00:00:00.0036468", 
      "HeadersInfo": null, 
      "Content": null 
    }
  • RequestWithHeaders(コンテンツ情報なしで要求ヘッダーと応答ヘッダーをログに記録します)。

    2021-06-03 17:07:13.475 +03:00 [Verbose] Sending HTTP request Http trace 
    { 
      "Id": 4, 
      "HttpMethod": { 
        "Method": "GET" 
      }, 
      "Uri": "https://xcp_xconnect:443/odata/Contacts?%24filter=Id+eq+8a167bdf-922c-0000-0000-062609e1e7c7&%24expand=Identifiers,MergeInfo,ConsentInformation", 
      "HeadersInfo": [ 
        { 
          "Key": "Accept", 
          "Value": [ 
            "application/json; odata.metadata.context=false" 
          ] 
        }, 
        { 
          "Key": "Host", 
          "Value": [ 
            "xcp_xconnect" 
          ] 
        }, 
        { 
          "Key": "OData-Version", 
          "Value": [ 
            "4.0" 
          ] 
        } 
      ], 
      "Content": null 
    } 
     
    2021-06-03 17:07:13.480 +03:00 [Verbose] Received HTTP response Http trace 
    { 
      "Id": 4, 
      "Uri": "https://xcp_xconnect:443/odata/Contacts?%24filter=Id+eq+8a167bdf-922c-0000-0000-062609e1e7c7&%24expand=Identifiers,MergeInfo,ConsentInformation", 
      "StatusCode": 200, 
      "Duration": "00:00:00.0043318", 
      "HeadersInfo": [ 
        { 
          "Key": "Content-Type", 
          "Value": [ 
            "application/json" 
          ] 
        } 
      ], 
      "Content": null 
    } 
  • Full(要求と応答からすべての情報をログに記録します)。

HTTP要求ログの詳細は、デフォルトでFullに設定されています。

ログの詳細を変更するには:

  • 構成ファイル\App_Data\Config\Sitecore\CoreServices\sc.XConnect.RequestLogging.Web.Host.xmlを開き、Settings/Sitecore/XConnect/Services/HttpRequestLoggingConfiguration/Options/HttpRequestAndResponseLogLevelノードの値を変更します。

    <Options>
        <HttpRequestAndResponseLogLevel>Full</HttpRequestAndResponseLogLevel>
    </Options> 
この記事を改善するための提案がある場合は、 お知らせください!