監視 SiteWise 邊緣閘道記錄檔 - AWS IoT SiteWise

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

監視 SiteWise 邊緣閘道記錄檔

您可以設定 AWS IoT SiteWise 邊緣閘道,將資訊記錄到 Amazon CloudWatch 日誌或本機檔案系統。

使用 Amazon CloudWatch 日誌

您可以設定 SiteWise Edge 閘道將記錄檔傳送至記 CloudWatch 錄檔。如需詳細資訊,請參閱AWS IoT Greengrass Version 2 開發人員指南的啟用記錄 CloudWatch 檔的記錄功能。

設定和存取 CloudWatch 記錄檔 (主控台)
  1. 導覽至 CloudWatch主控台

  2. 在導覽窗格中,選擇 Log groups (日誌群組)。

  3. 您可以在下列記錄群組中找到 AWS IoT SiteWise 元件記錄檔:

    • /aws/greengrass/UserComponent/region/aws.iot.SiteWiseEdgeCollectorOpcua— 邊 SiteWise 緣閘道元件的記錄,用於從邊 SiteWise 緣閘道的 OPC-UA 來源收集資料。

    • /aws/greengrass/UserComponent/region/aws.iot.SiteWiseEdgePublisher— 將 OPC-UA 資料串流發佈到的 SiteWise 邊緣閘道元件的記錄檔。 AWS IoT SiteWise

    選擇函數要除錯的日誌群組。

  4. 選擇名稱以 AWS IoT Greengrass 群組名稱結尾的記錄資料流。依預設, CloudWatch 會先顯示最新的記錄資料流。

    
              CloudWatch 日誌「日誌組」頁面截圖。
  5. 若要顯示過去 5 分鐘的日誌,請執行下列動作:

    1. 選擇右上角的 custom (自訂)

    2. 選擇 Relative (相對)

    3. 選擇 5 分鐘。

    4. 選擇套用

    
              CloudWatch 「日誌」頁面截圖。
  6. (選用) 若要查看較少的日誌,您可以從右上角選擇 1m (1 分鐘)

  7. 捲動至日誌項目底部以顯示最近的日誌。

使用服務記錄

SiteWise Edge 閘道裝置包含服務記錄檔,以協助偵錯問題。下列各節將協助您尋找並使用 AWS IoT SiteWise OPC-UA 收集器和 AWS IoT SiteWise 發行者元件的服務記錄檔。

AWS IoT SiteWise OPC-UA 收集器服務記錄檔

AWS IoT SiteWise OPC-UA 收集器元件使用下列記錄檔。

Linux
/greengrass/v2/logs/aws.iot.SiteWiseEdgeCollectorOpcua.log
Windows
C:\greengrass\v2\logs\aws.iot.SiteWiseEdgeCollectorOpcua.log
若要檢視此元件的記錄
  • 在核心裝置上執行下列命令,即時檢視此元件的記錄檔。以 AWS IoT Greengrass 根資料夾的路徑取代/greengrass/v2C:\greengrass\v2

    Linux
    sudo tail -f /greengrass/v2/logs/aws.iot.SiteWiseEdgeCollectorOpcua.log
    Windows (PowerShell)
    Get-Content C:\greengrass\v2\logs\aws.iot.SiteWiseEdgeCollectorOpcua.log -Tail 10 -Wait

AWS IoT SiteWise 發行者服務記錄檔

「 AWS IoT SiteWise 發行者」元件會使用下列記錄檔。

Linux
/greengrass/v2/logs/aws.iot.SiteWiseEdgePublisher.log
Windows
C:\greengrass\v2\logs\aws.iot.SiteWiseEdgePublisher.log
若要檢視此元件的記錄
  • 在核心裝置上執行下列命令,即時檢視此元件的記錄檔。以 AWS IoT Greengrass 根資料夾的路徑取代/greengrass/v2C:\greengrass\v2

    Linux
    sudo tail -f /greengrass/v2/logs/aws.iot.SiteWiseEdgePublisher.log
    Windows (PowerShell)
    Get-Content C:\greengrass\v2\logs\aws.iot.SiteWiseEdgePublisher.log -Tail 10 -Wait

使用事件記錄

SiteWise Edge 閘道裝置包含事件記錄檔,以協助偵錯問題。下列各節將協助您尋找並使用 AWS IoT SiteWise OPC-UA 收集器和 AWS IoT SiteWise 發行者元件的事件記錄檔。

AWS IoT SiteWise OPC-UA 收集器事件記錄

AWS IoT SiteWise OPC-UA 收集器元件包含事件記錄,可協助客戶識別並修正問題。記錄檔與本機記錄檔不同,可在下列位置找到。以 AWS IoT Greengrass 根資料夾的路徑取代/greengrass/v2C:\greengrass\v2

Linux
/greengrass/v2/work/aws.iot.SiteWiseEdgeCollectorOpcua/logs/IotSiteWiseOpcUaCollectorEvents.log
Windows
C:\greengrass\v2\work\aws.iot.SiteWiseEdgeCollectorOpcua\logs\IotSiteWiseOpcUaCollectorEvents.log

此記錄檔包含詳細資訊和疑難排解指示。疑難排解資訊會與診斷程式一起提供,其中包含如何解決問題的說明,有時還會提供進一步資訊的連結。診斷資訊包括下列項目:

  • 嚴重性等級

  • 時間戳記

  • 其他事件特定資訊

範例日誌
dataSourceConnectionSuccess: Summary: Successfully connected to OpcUa server Level: INFO Timestamp: '2023-06-15T21:04:16.303Z' Description: Successfully connected to the data source. AssociatedMetrics: - Name: FetchedDataStreams Description: The number of fetched data streams for this data source Value: 1.0 Namespace: IoTSiteWise Dimensions: - Name: SourceName Value: SourceName{value=OPC-UA Server} - Name: ThingName Value: test-core AssociatedData: - Name: DataSourceTrace Description: Name of the data source Data: - OPC-UA Server - Name: EndpointUri Description: The endpoint to which the connection was attempted. Data: - '"opc.tcp://10.0.0.1:1234"'

AWS IoT SiteWise 發佈者事件記錄

AWS IoT SiteWise Publisher 元件包含事件記錄檔,可協助客戶識別並修正問題。記錄檔與本機記錄檔不同,可在下列位置找到。以 AWS IoT Greengrass 根資料夾的路徑取代/greengrass/v2C:\greengrass\v2

Linux
/greengrass/v2/work/aws.iot.SiteWiseEdgePublisher/logs/IotSiteWisePublisherEvents.log
Windows
C:\greengrass\v2\work\aws.iot.SiteWiseEdgePublisher\logs\IotSiteWisePublisherEvents.log

此記錄檔包含詳細資訊和疑難排解指示。疑難排解資訊會與診斷程式一起提供,其中包含如何解決問題的說明,有時還會提供進一步資訊的連結。診斷資訊包括下列項目:

  • 嚴重性等級

  • 時間戳記

  • 其他事件特定資訊

範例日誌
accountBeingThrottled: Summary: Data upload speed slowed due to quota limits Level: WARN Timestamp: '2023-06-09T21:30:24.654Z' Description: The IoT SiteWise Publisher is limited to the "Rate of data points ingested" quota for a customers account. See the associated documentation and associated metric for the number of requests that were limited for more information. Note that this may be temporary and not require any change, although if the issue continues you may need to request an increase for the mentioned quota. FurtherInformation: - https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html - https://docs.aws.amazon.com/iot-sitewise/latest/userguide/troubleshooting-gateway.html#gateway-issue-data-streams AssociatedMetrics: - Name: TotalErrorCount Description: The total number of errors of this type that occurred. Value: 327724.0 AssociatedData: - Name: AggregatePropertyAliases Description: The aggregated property aliases of the throttled data. FileLocation: /greengrass/v2/work/aws.iot.SiteWiseEdgePublisher/./logs/data/AggregatePropertyAliases_1686346224654.log