Update......
Sorry for the last answer. I get your point now.
The reason is that we didn't have a TraceListener
in our code.
You could add this in your code:
Trace.Listeners.Add(new ConsoleTraceListener());
I found it from the second answer here: Azure WebJobs: Can't find Trace logging.
If it didn't work, check your runtime. You can see it is different adding logs in .NET or .NET Core from this article: https://docs.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs#add-log-messages-in-code
enter image description here
--------------------------------------------------------Dividing line-------------------------------------------------------
I tried to deploy a WebJob using your code, and I found that maybe you should change the log's level in app service log settings to Verbose
:
enter image description here
You can see the details in different log's level in this page:
enter image description here
When I set the logs level to Information
and run the WebJob, there is nothing added in my blob.
enter image description here
After I change the logs level to Verbose
and run the WebJob, there are the information added.
enter image description here