I'm using a consumption plan Linux Function, published using VS. Everything works locally, but for some reason I can't see any logs when I deploy it.
I tried 'Log Stream - Application Insights', nothing there except some framework logs...
i.e.:
2020-09-22T04:14:59Z [Verbose] Poll for function 'EmailQueueWorker' on queue 'email' with ClientRequestId '6106f3ec-52b6-4b0d-b525-887383a6fb12' found 0 messages in 4 ms.
I can't access SCM (no support for Linux on consumption plan)...
This is my 'host.json' configuration:
{
"logging": {
"fileLoggingMode": "always",
"logLevel": {
"default": "Information",
"Host.Results": "Error",
"Function": "Trace",
"Host.Aggregator": "Trace"
},
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
"isEnabled": true
}
},
"console": {
"isEnabled": "true"
}
},
"Values": {
"AzureWebJobsStorage": "******",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
},
"version": "2.0"
}
This is my code:
[FunctionName("EmailQueueWorker")]
public static async Task Run(
[QueueTrigger(queueName: "email", Connection = "AzureWebJobsStorage")] string queueItem,
ILogger log
)
{
log.LogTrace($"Handling: {queueItem}");
}
I do occasionally find exceptions (it takes a lot of time) in the "Log" query results, but most of the time it doesn't work at all (no exceptions caught) or takes a lot of time to get there.
Thanks