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.
In my WebJob I write logging messages using
Trace.TraceInformation("blah blah blah");
In the configuration file's application diagnostics section I have blob storage logging turned on with the "Verbose" option.
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.
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:
And the configured blob storage is definitely the same as the one I'm looking in.
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.
It should be look like below:
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 ...");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With