如何登录Azure Web作业?

时间:2014-05-30 18:54:58

标签: azure azure-webjobs

所以我尝试过:

Trace.TraceInformation("Trace.Information Found message on queue");
Debug.WriteLine("Debug Found message on queue"); 
Trace.WriteLine("Trace.WriteLine Found message on queue");
Console.WriteLine("Console.WriteLine Found message on queue");

但它们都没有输出到Azure门户Web作业输出日志。

我错过了什么?

2 个答案:

答案 0 :(得分:3)

稍后编辑: 自Beta版以来,下面的答案不再正确。为了记录消息,您必须立即使用TextWriter,如下所示: https://github.com/Azure/azure-webjobs-sdk-samples/blob/master/BasicSamples/MiscOperations/Program.cs


Console.WriteLine应该可以工作。如果这不起作用,您可以发布更多代码吗?

对于从函数内部写入的消息,日志应显示在函数调用页面上。

对于在函数外部写入的消息,日志应显示在作业输出日志中。

答案 1 :(得分:2)

Console.WriteLine为我工作但log.WriteLine(根据SDK示例)没有。

原来我需要在门户中设置Webjob连接字符串,即使我在App.config中定义了AzureWebJobsDashboard和AzureWebJobsStorage。