简体   繁体   English

从Azure Cloud Service Worker角色收集/查看日志的最简单方法

[英]Simplest way to collect/view logs from an Azure Cloud Service Worker Role

I have an Azure Cloud Service Worker Role with Diagnostics enabled. 我有一个启用了诊断的Azure云服务工作者角色。 Nlog with a console writer is used to write app logs. 带有控制台编写器的Nlog用于编写应用程序日志。

I know that those logs end up in WADLogsTable on my Storage account. 我知道这些日志最终存储在我的存储帐户的WADLogsTable中。 The question is what is the best way to view/analyze those log entries. 问题是查看/分析这些日志条目的最佳方法是什么。 I found a tool named "Azure Diagnostics Viewer", but it's only able to view/analyze logs for the last day. 我找到了一个名为“ Azure Diagnostics Viewer”的工具,但是它只能查看/分析最后一天的日志。 Also, I'd like the tool to be able to extract "fields" from my log entries, eg TimeStamp, Log Level and so on. 另外,我希望该工具能够从我的日志条目中提取“字段”,例如TimeStamp,Log Level等。

Am I missing something that's on the surface? 我是否想念表面上的东西?

This article highlights tools that can be used to view diagnostic data stored in WADlogsTable. 本文重点介绍了可用于查看WADlogsTable中存储的诊断数据的工具。 Relevant excerpt below. 相关摘录如下。

Tools to view diagnostic data Several tools are available to view the data after it is transferred to storage. 查看诊断数据的工具有几种工具可用于将数据传输到存储后查看数据。 For example: • Server Explorer in Visual Studio - If you have installed the Azure Tools for Microsoft Visual Studio, you can use the Azure Storage node in Server Explorer to view read-only blob and table data from your Azure storage accounts. 例如:•Visual Studio中的服务器资源管理器-如果已安装Microsoft Visual Studio的Azure工具,则可以使用服务器资源管理器中的“ Azure存储”节点来查看Azure存储帐户中的只读Blob和表数据。 You can display data from your local storage emulator account and also from storage accounts you have created for Azure. 您可以显示本地存储模拟器帐户中的数据,也可以显示为Azure创建的存储帐户中的数据。 For more information, see Browsing and Managing Storage Resources with Server Explorer. 有关更多信息,请参见使用Server Explorer浏览和管理存储资源。 • Microsoft Azure Storage Explorer is a standalone app that enables you to easily work with Azure Storage data on Windows, OSX, and Linux. •Microsoft Azure存储资源管理器是一个独立的应用程序,使您可以轻松地在Windows,OSX和Linux上使用Azure存储数据。 • Azure Management Studio includes Azure Diagnostics Manager which allows you to view, download and manage the diagnostics data collected by the applications running on Azure. •Azure Management Studio包括Azure Diagnostics Manager,它使您可以查看,下载和管理在Azure上运行的应用程序收集的诊断数据。

To analyze the saved logs for insights , I recommend using Azure Log analytics. 要分析保存的日志以获取见解 ,我建议使用Azure日志分析。 Reference this lin k for usage details - overview snipped below; 请参考此语言以获取用法详细信息-概述如下。 Log Analytics plays a central role in Azure management by collecting telemetry and other data from a variety of sources and providing a query language and analytics engine that gives you insights into the operation of your applications and resources. Log Analytics通过收集来自各种来源的遥测和其他数据,并提供查询语言和分析引擎,使您可以深入了解应用程序和资源的运行,从而在Azure管理中发挥了核心作用。 You can either interact directly with Log Analytics data through log searches and views, or you may use analysis tools in other Azure services that store their data in Log Analytics such as Application Insights or Azure Security Center. 您可以通过日志搜索和视图直接与Log Analytics数据进行交互,也可以在将其他数据存储在Log Analytics中的其他Azure服务中使用分析工具,例如Application Insights或Azure安全中心。

Hope this helps. 希望这可以帮助。

I use Azure Management Studio from Cerebrata ( https://www.cerebrata.com/products/azure-management-studio ). 我使用Cerebrata( https://www.cerebrata.com/products/azure-management-studio )的Azure Management Studio。

It has comprehensive functionality for viewing, filtering, searching etc. the WADLogsTable. 它具有用于查看,过滤,搜索等的综合功能。WADLogsTable。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM