Azure 资源日志概述Azure Resource logs overview

Azure 资源日志是 Azure 资源发出的描述内部操作的平台日志Azure Resource logs are platform logs emitted by Azure resources that describe their internal operation. 所有资源日志共享通用的顶级架构,且每个服务都能灵活地为各自的事件发出唯一属性。All resource logs share a common top-level schema with the flexibility for each service to emit unique properties for their own events.

Note

资源日志以前称为诊断日志。Resource logs were previously known as diagnostic logs.

收集资源日志Collecting resource logs

资源日志由支持的 Azure 资源自动生成,但除非你通过诊断设置配置它们,否则系统不会收集它们。Resource logs are automatically generated by supported Azure resources, but they aren't collected unless you configure them using a diagnostic setting. 请为每个 Azure 资源创建诊断设置,以便将这些日志转发到以下目标:Create a diagnostic setting for each Azure resource to forward the logs to the following destinations:

目标Destination 方案Scenario
Log Analytics 工作区Log Analytics workspace 借助其他监视数据对日志进行分析,并利用 Azure Monitor 功能(例如日志查询和日志警报)。Analyze the logs with other monitoring data and leverage Azure Monitor features such as log queries and log alerts.
Azure 存储Azure storage 将日志存档供审核或备份。Archive the logs for auditing or backup.
事件中心Event hub 将日志流式传输到第三方日志记录和遥测系统。Stream the logs to third-party logging and telemetry systems.

计算资源Compute resources

资源日志不同于 Azure 计算资源中的来宾 OS 级别日志。Resource logs differ from guest OS-level logs in Azure compute resources. 计算资源需要通过代理从其来宾 OS 中收集日志和指标,包括事件日志、syslog 和性能计数器之类的数据。Compute resources require an agent to collect logs and metrics from their guest OS, including such data as event logs, syslog, and performance counters. 请使用诊断扩展路由 Azure 虚拟机中的日志数据,使用 Log Analytics 代理将 Azure 中的虚拟机、其他云中的虚拟机和本地的虚拟机中的日志和指标收集到 Log Analytics 工作区。Use the Diagnostic Extension to route log data from Azure virtual machines and the Log Analytics agent to collect logs and metrics from virtual machines in Azure, in other clouds, and on-premises into a Log Analytics workspace. 有关详细信息,请参阅 Azure Monitor 的监视数据源See Sources of monitoring data for Azure Monitor for details.

资源日志架构Resource logs schema

有关资源日志架构和类别的详细信息,请参阅资源日志架构For more information on the resource logs schema and categories, see Resource Log Schema.

后续步骤Next Steps