Azure WebJobs:找不到跟踪日志记录 [英] Azure WebJobs: Can't find Trace logging

查看:71
本文介绍了Azure WebJobs:找不到跟踪日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照此Microsoft页面,用于记录来自Azure WebJob的消息,但我的消息均未出现在日志中.

I've followed the instructions on this Microsoft webpage for logging messages from an Azure WebJob, but none of my messages appear in the log.

在我的Web作业中,我使用

In my WebJob I write logging messages using

Trace.TraceInformation("blah blah blah");

在配置文件的应用程序诊断部分中,使用详细"选项打开了Blob存储日志记录.

In the configuration file's application diagnostics section I have blob storage logging turned on with the "Verbose" option.

正在创建日志文件 (尽管有时我需要等待几分钟-在某些情况下,直到第二天早上-直到日志出现在Blob存储中为止),但是日志中却没有包含我的日志文件跟踪消息.

Log files are being created (though I sometimes have to wait several minutes - in one case until the following morning - until the logs appear in the blob storage) but the logs don't contain my Trace messages.

那么我该如何将消息记录到这些日志文件中,和/或将 Trace 写入哪里?

So how do I log messages to these log files, and/or where does Trace get written to?

这是我配置的日志记录选项的图像:

Here is an image of my configured options for logging:

配置的Blob存储肯定与我要查找的存储相同.

And the configured blob storage is definitely the same as the one I'm looking in.

推荐答案

要为Web Job日志指定存储帐户,您需要在 CONFIGURE 选项卡> 连接字符串部分,连接字符串的名称必须为 AzureWebJobsDashboard .

To specify the storage account for Web Job logs, you need to add connection string under CONFIGURE tab > connection string sections, name of the connection string has to be AzureWebJobsDashboard.

应如下图所示:

  • 名称: AzureWebJobsDashboard
  • : DefaultEndpointsProtocol = https; AccountName ="; AccountKey ="
  • 类型:自定义
  • Name: AzureWebJobsDashboard
  • Value: DefaultEndpointsProtocol=https;AccountName="";AccountKey=""
  • Type: Custom

您还可以在Azure门户中查看日志,打开Web应用程序并选择 WEBJOBS 选项卡,单击Web作业的URL,它将显示上一次运行,单击 Toggle 按钮,其中显示了运行的详细信息,包括应用使用以下语句编写的自定义消息.

You can also view logs in Azure portal, open the Web app and select WEBJOBS tab, click on the URL of web job, it will show the last runs, click on Toggle button, which shown details of the run including the custom messages written by app using below statement.

Console.WriteLine("Error While Doing Something ...");

这篇关于Azure WebJobs:找不到跟踪日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆