函数应用程序日志未显示

函数应用程序日志未显示

本文介绍了Azure 函数应用程序日志未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Azure 比较陌生,我刚刚完成了有关如何创建新 Azure 函数的教程,该函数在创建新 blob 时触发,并将其作为默认代码.

I'm relatively new to Azure and I just went through the tutorial on how to create a new Azure function, which is triggered when a new blob is created, and had this as the default code in it.

public static void Run(Stream myBlob, string name, TraceWriter log)
{
    log.Info($"C# Blob trigger function Processed blob
 Name:{name}
 Size: {myBlob.Length} Bytes");
}

根据我在教程中看到的内容,我应该能够在代码下方的日志"区域中看到一些信息,但没有任何显示,我已经检查了一段时间的解决方案但不能似乎找不到任何有用的东西.

From what I can see on the tutorial, I should be able to see some information in the "logs" area below the code, but nothing shows up, I've been checking for a solution for a while now but can't seem to find anything useful.

任何帮助将不胜感激.

推荐答案

日志窗口有点脆弱,并不总是显示日志.但是,日志也会写入日志文件.

The log window is a bit fragile and doesn't always show the logs. However, logs are also written to the log files.

您可以从 Kudu 控制台访问这些日志:https://[your-function-app].scm.azurewebsites.net/

You can access these logs from the Kudu console:https://[your-function-app].scm.azurewebsites.net/

从菜单中,选择调试控制台 > CMD

From the menu, select Debug console > CMD

在文件列表中,进入 LogFiles > Application > Functions > Function > [Name of your function]

On the list of files, go into LogFiles > Application > Functions > Function > [Name of your function]

在那里你会看到一个日志文件列表.

There you will see a list of log files.

这篇关于Azure 函数应用程序日志未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!