繁体   English   中英

如何从 Azure 分析日志上的 AzureVM 获取应用程序日志

[英]How to get application logs from AzureVM on Azure Analytics Log

我有一个 azure Linux VM,我想在其中运行具有简单标准输出日志的自定义应用程序。 作为假设,假设 python 应用程序将 print("This is a log") 中的日志作为日志。 我希望在 azure 日志分析中流式传输和查询所有标准输出日志。

  1. 创建了日志分析资源
  2. 连接我的 azure linux 虚拟机

现在我还应该做什么才能在日志分析中查看所有标准输出日志?

您可以选择使用 Azure 监视器中的 Log Analytics 代理收集自定义日志

Azure Monitor 中的 Log Analytics 代理的自定义日志数据源允许您从 Windows 和 Linux 计算机上的文本文件中收集事件。 收集后,您可以将数据解析到查询中的各个字段中,也可以在收集期间将数据提取到各个字段中。

请注意,要收集的日志文件必须符合一定的条件和格式。 更多关于它的信息可以在这里找到。

If custom logs do not fit your use-case, you can use other strategies like using custom scripts to write to sources supported by Azure Monitor, or pumping data directly to Azure Monitor using HTTP Data Collector API .

暂无
暂无

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

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