Azure 事件网格主题/域的诊断日志Diagnostic logs for Azure Event Grid topics/domains

诊断设置允许事件网格用户在以下任一位置捕获和查看“发布和传递失败”日志:存储帐户、事件中心或 Log Analytics 工作区****。Diagnostic settings allow Event Grid users to capture and view publish and delivery failure logs in either a Storage account, an event hub, or a Log Analytics Workspace. 本文提供了日志的架构和示例日志条目。This article provides schema for the logs and an example log entry.

发布/传递失败日志的架构Schema for publish/delivery failure logs

属性名称Property name 数据类型Data type 说明Description
时间Time DateTimeDateTime 生成日志项目的时间The time when the log entry was generated

示例值: 01-29-2020 09:52:02.700Example value: 01-29-2020 09:52:02.700

EventSubscriptionNameEventSubscriptionName StringString 事件订阅的名称The name of the event subscription

示例值: “EVENTSUB1”Example value: "EVENTSUB1"

仅传递失败日志有此属性。This property exists only for delivery failure logs.

CategoryCategory StringString 日志类别名称。The log category name.

示例值: “DeliveryFailures”或“PublishFailures”Example values: "DeliveryFailures" or "PublishFailures"

OperationNameOperationName StringString 遇到故障时执行的操作的名称。The name of the operation performed while encountering the failure.

示例值: “Deliver”,用于传递失败。Example Values: "Deliver" for delivery failures.

MessageMessage StringString 用户的日志消息,说明失败的原因和其他详细信息。The log message for the user explaining the reason for the failure and other additional details.
ResourceIdResourceId StringString 主题/域资源的资源 IDThe resource ID for the topic/domain resource

示例值: /SUBSCRIPTIONS/SAMPLE-SUBSCRIPTION-ID/RESOURCEGROUPS/SAMPLE-RESOURCEGROUP/PROVIDERS/MICROSOFT.EVENTGRID/TOPICS/TOPIC1Example Values: /SUBSCRIPTIONS/SAMPLE-SUBSCRIPTION-ID/RESOURCEGROUPS/SAMPLE-RESOURCEGROUP/PROVIDERS/MICROSOFT.EVENTGRID/TOPICS/TOPIC1

示例Example

{
    "time": "2019-11-01T00:17:13.4389048Z",
    "resourceId": "/SUBSCRIPTIONS/SAMPLE-SUBSCTIPTION-ID /RESOURCEGROUPS/SAMPLE-RESOURCEGROUP-NAME/PROVIDERS/MICROSOFT.EVENTGRID/TOPICS/SAMPLE-TOPIC-NAME ",
    "eventSubscriptionName": "SAMPLEDESTINATION",
    "category": "DeliveryFailures",
    "operationName": "Deliver",
    "message": "Message:outcome=NotFound, latencyInMs=2635, systemId=17284f7c-0044-46fb-84b7-59fda5776017, state=FilteredFailingDelivery, deliveryTime=11/1/2019 12:17:10 AM, deliveryCount=0, probationCount=0, deliverySchema=EventGridEvent, eventSubscriptionDeliverySchema=EventGridEvent, fields=InputEvent, EventSubscriptionId, DeliveryTime, State, Id, DeliverySchema, LastDeliveryAttemptTime, SystemId, fieldCount=, requestExpiration=1/1/0001 12:00:00 AM, delivered=False publishTime=11/1/2019 12:17:10 AM, eventTime=11/1/2019 12:17:09 AM, eventType=Type, deliveryTime=11/1/2019 12:17:10 AM, filteringState=FilteredWithRpc, inputSchema=EventGridEvent, publisher=DIAGNOSTICLOGSTEST-EASTUS.EASTUS-1.EVENTGRID.AZURE.NET, size=363, fields=Id, PublishTime, SerializedBody, EventType, Topic, Subject, FilteringHashCode, SystemId, Publisher, FilteringTopic, TopicCategory, DataVersion, MetadataVersion, InputSchema, EventTime, fieldCount=15, url=sb://diagnosticlogstesting-chinanorth.servicebus.chinacloudapi.cn/, deliveryResponse=NotFound: The messaging entity 'sb://diagnosticlogstesting-chinanorth.servicebus.chinacloudapi.cn/eh-diagnosticlogstest' could not be found. TrackingId:c98c5af6-11f0-400b-8f56-c605662fb849_G14, SystemTracker:diagnosticlogstesting-chinanorth.servicebus.chinacloudapi.cn:eh-diagnosticlogstest, Timestamp:2019-11-01T00:17:13, referenceId: ac141738a9a54451b12b4cc31a10dedc_G14:"
}

后续步骤Next steps

若要了解如何为主题或域启用诊断日志,请参阅启用诊断日志To learn how to enable diagnostic logs for topics or domains, see Enable diagnostic logs.