1. 拡張xConnectログ

xConnect操作ログの設定

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

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

拡張されたxConnectログには、xConnectコマンドの実行前後の操作状態の追跡が含まれます。

各操作は一意のバッチIDを持っています。操作が失敗した場合、前任および後継操作の操作IDもログに記録されます。デフォルトでは無効化されています。

xConnect操作のログ出力には、各コマンド実行のログエントリとBatchIdフィールドが含まれています。関連するコマンドのログはこのBatchIdで見つけることができます。

ログ出力は以下の通りです:

  • バッチのID。
  • 作戦名。
  • バッチ内のオペレーションID。
  • 作戦の進行状況。
  • 操作パラメータ(例えば、連絡先ID、識別子フィールド、ファセット情報など)。
  • 前身または後継機のオペレーションID。

xConnect操作ログを有効にする

xConnect操作ログングを有効にするには:

  • ファイル名を\App_Data\Config\Sitecore\Collection\sc.XConnect.Collection.Web.Logging.xmlに変えて\App_Data\Config\Sitecore\Collection\sc.XConnect.Collection.Web.Logging.xml.disabledを有効にしてください。

xConnect操作ログの例

xConnect操作のログ出力には、各コマンド実行のログエントリが含まれています。例えば:

2021-05-31 `21

`
.695 +`03
` Verbose Operation trace { "BatchId": "e24aa982-875e-4c2e-a2d8-3ef61dba68a9", "Command": "Executed", "Operations": { "BatchId": "e24aa982-875e-4c2e-a2d8-3ef61dba68a9", "BatchIndex": 0, "OperationName": "AddContactOperation", "OperationId": 9, "Status": "Succeeded", "OperationType": "Create", "Info": { "Name": "Parameters", "Value": { "Name": "Contact id", "Value": "edb8f791-b618-0000-0000-062578a79910" }, { "Name": "Identifiers", "Value":

{ "Name": "Identifier type", "Value": "Anonymous" }, { "Name": "Source", "Value": "Tests.contact.source" }, { "Name": "Value", "Value": ".13.M.MergeOperationShouldFailIfOneOfContactsIsNull7a7bd39e7bb94f09905d3184d3df4d2c" } ,

{ "Name": "Identifier type", "Value": "Anonymous" }, { "Name": "Source", "Value": "Alias" }, { "Name": "Value", "Value": "903aa80a-556f-4b9c-9149-9846dea55718" }

}

}, { "Name": "Successors Ids", "Value": " 11 " }

}, { "BatchId": "e24aa982-875e-4c2e-a2d8-3ef61dba68a9", "BatchIndex": 2, "OperationName": "SetFacetOperation`1", "OperationId": 11, "Status": "Succeeded", "OperationType": "Update", "Info": { "Name": "Parameters", "Value": { "Name": "Entity type", "Value": "Contact" }, { "Name": "Entity id", "Value": "edb8f791-b618-0000-0000-062578a79910" }, { "Name": "Facet key", "Value": "Personal" }

}, { "Name": "Predecessors Ids", "Value": " 9 " }

}

}

ログレベルを変えてください

xConnect操作が実行中に例外を投げた場合、以下のいずれかのタイプをログに記録します。

  • Only type (例外の種類のみ)
  • Medium (例外の型とメッセージ)
  • Full (例外インスタンスに含まれる完全な情報)

デフォルトでは、ログタイプレベルはMediumです。

ログタイプのレベルを変更するには:

  • 設定ファイルを開いて\App_Data\Config\Sitecore\Collection\sc.XConnect.Collection.Web.Logging.xmlSettings/Sitecore/XConnect/Collection/Services/ExceptionLogFormatter/Options/ExceptionLogLevelノードの値を変更してください。

    Medium

OnlyTypeレベルの例外例

以下はOnlyTypeログレベルのログ出力の例です。

2021-05-31 `21

`
.581 +`03
` Verbose Operation trace { "BatchId": "3813c258-ae24-4a61-974f-62daa2f83bee", "Command": "Executed", "Operations": { "BatchId": "3813c258-ae24-4a61-974f-62daa2f83bee", "BatchIndex": 0, "OperationName": "AddContactOperation", "OperationId": 1, "Status": "Failed", "OperationType": "Create", "Info": { "Name": "Exception", "Value": "ShardManagementException" }

}

}

中レベルの例外例:

以下はMediumログレベルのログ出力の例です。

2021-05-31 `21

`
.726 +`03
` Verbose Operation trace { "BatchId": "a2e0e099-9be3-428b-98c9-a6c45c334859", "Command": "Executed", "Operations": { "BatchId": "a2e0e099-9be3-428b-98c9-a6c45c334859", "BatchIndex": 0, "OperationName": "AddContactOperation", "OperationId": 1, "Status": "Failed", "OperationType": "Create", "Info": { "Name": "Exception", "Value": { "Name": "ShardManagementException", "Message": "Store Error: Login failed for user 'sa'.. The error occurred while attempting to perform the underlying storage operation during 'Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreException : Error occurred while performing store operation. See the inner SqlException for details. ---> System .Data.SqlClient.SqlException: Login failed for user 'sa'.\r\n at System.Data.SqlClient .SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)\r\n at System.Data.SqlClient.SqlConnectionFactory .CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)\r\n at System.Data .ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)\r\n at System .Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest (DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase.DbConnectionPool .TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection (DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase .DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)\r\n at System.Data .SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)\r\n at System.Data.SqlClient .SqlConnection.TryOpen(TaskCompletionSource`1 retry)\r\n at System.Data.SqlClient.SqlConnection.Open()\r\n at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.SqlUtils.WithSqlExceptionHandling(Action operation)\r\n --- End of inner exception stack trace ---\r\n at Microsoft.Azure.SqlDatabase .ElasticScale.ShardManagement.SqlUtils.WithSqlExceptionHandling(Action operation)\r\n at Microsoft.Azure .SqlDatabase.ElasticScale.ShardManagement.StoreOperationGlobal.b__10_0()\r\n at Microsoft.Azure .SqlDatabase.ElasticScale.TransientFaultHandling.RetryPolicy.ExecuteActionTResult(Func`1 func)\r\n at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreOperationGlobal.Do()' operation on the shard map manager database. See the inner StoreException for details." } }

}

}

レベル例外の例:

以下はFullログレベルのログ出力の例です。

2021-05-31 `22

`
.197 +`03
` Verbose Operation trace { "BatchId": "febf5249-fbf6-4d52-a9ef-3941cac2c31b", "Command": "Executed", "Operations": { "BatchId": "febf5249-fbf6-4d52-a9ef-3941cac2c31b", "BatchIndex": 0, "OperationName": "AddContactOperation", "OperationId": 1, "Status": "Failed", "OperationType": "Create", "Info": { "Name": "Exception", "Value": { "ErrorCategory": 0, "ErrorCode": 17, "ClassName": "Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ShardManagementException", "Message": "Store Error: Login failed for user 'sa'.. The error occurred while attempting to perform the underlying storage operation during 'Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreException : Error occurred while performing store operation. See the inner SqlException for details. ---> System .Data.SqlClient.SqlException: Login failed for user 'sa'.\r\n at System.Data.SqlClient .SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)\r\n at System.Data.SqlClient.SqlConnectionFactory .CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)\r\n at System.Data .ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)\r\n at System .Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest (DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\r\n at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase.DbConnectionPool .TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection (DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase .DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)\r\n at System.Data .SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)\r\n at System.Data.SqlClient .SqlConnection.TryOpen(TaskCompletionSource`1 retry)\r\n at System.Data.SqlClient.SqlConnection.Open()\r\n at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.SqlUtils.WithSqlExceptionHandling(Action operation)\r\n --- End of inner exception stack trace ---\r\n at Microsoft.Azure.SqlDatabase .ElasticScale.ShardManagement.SqlUtils.WithSqlExceptionHandling(Action operation)\r\n at Microsoft.Azure .SqlDatabase.ElasticScale.ShardManagement.StoreOperationGlobal.b__10_0()\r\n at Microsoft.Azure .SqlDatabase.ElasticScale.TransientFaultHandling.RetryPolicy.ExecuteActionTResult(Func`1 func)\r\n at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreOperationGlobal.Do()' operation on the shard map manager database. See the inner StoreException for details.", "Data": null, "InnerException": null, "HelpURL": null, "StackTraceString": "at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreOperationGlobal.Do ()\r\n at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ShardMapManagerFactory .GetSqlShardMapManager(String connectionString, SqlCredential secureCredential, ShardMapManagerLoadPolicy loadPolicy, RetryBehavior retryBehavior, EventHandler`1 retryEventHandler, Boolean throwOnFailure)\r\n at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ShardMapManagerFactory.TryGetSqlShardMapManager (String connectionString, SqlCredential secureCredential, ShardMapManagerLoadPolicy loadPolicy, RetryBehavior retryBehavior, ShardMapManager& shardMapManager)\r\n at Sitecore.Xdb.Collection.Data .SqlServer.Configuration.ElasticScaleConnectionManager.InitializeShardMapManager()\r\n at Sitecore.Xdb .Collection.Data.SqlServer.Configuration.ElasticScaleConnectionManager.get_ShardMapManager()\r\n at Sitecore.Xdb.Collection.Data.SqlServer.Configuration.ElasticScaleConnectionManager.GetRangeShardMap(String rangeShardMapName)\r\n at Sitecore.Xdb.Collection.Data.SqlServer.Configuration .ElasticScaleConnectionManager.<>c__DisplayClass33_0.b__0()\r\n at System.Lazy`1 .CreateValue()\r\n at System.Lazy`1.LazyInitValue()\r\n at Sitecore.Xdb.Collection.Data.SqlServer .Configuration.MemoryCacheManager.AddOrGetExistingFromCacheT(String key, Func`1 valueFactory)\r\n at Sitecore.Xdb.Collection.Data.SqlServer.Configuration.ElasticScaleConnectionManager.MapRecordsToShardsT (String rangeShardMapName, IReadOnlyCollection`1 records, Func`2 getShardKey)\r\n at Sitecore.Xdb .Collection.Data.SqlServer.Managers.SqlContactRecordsManager.d__29 .MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System .Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at Sitecore.Xdb.Collection.Data.SqlServer .Managers.SqlContactRecordsManager.d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices .ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter .HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Sitecore.Xdb.Collection.Data.SqlServer .SqlDataProvider.d__16.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Sitecore.Xdb.Collection.DataProviderCountersDecorator.d__24.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices .ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter .HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Sitecore.Xdb.Collection.Repository.d__12.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices .TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Sitecore.XConnect.Service .RepositorySaveOperationInvoker.d__10.MoveNext()", "RemoteStackTraceString": null, "RemoteStackIndex": 0, "ExceptionMethod": "8\nDo\nMicrosoft.Azure.SqlDatabase.ElasticScale.Client, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null\nMicrosoft.Azure.SqlDatabase.ElasticScale.ShardManagement.StoreOperationGlobal\nMicrosoft.Azure.SqlDatabase.ElasticScale.ShardManagement.IStoreResults Do()", "HResult": -2146233088, "Source": "Microsoft.Azure.SqlDatabase.ElasticScale.Client", "WatsonBuckets": null } }

}

}

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