Currently, I have a project which is using Azure Function with .net core 3.1 and I would like to know how to trace every method called for example:
[FunctionName("Count")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "Count")] HttpRequest req,
ILogger log)
{
int cnt = selectCount("Select * from A");
}
public static int selectCount(string str)
{
return 2;
}
And it will record to Azure Log Analytics workspace without Log.Information("Function:Count Start");
and Log.Information("selectCount Start");
Log message Sample as below
_________________________________________________ | TimeGenerated | Message | |2020/11/17 09:00:00.000 | Function:Count Start | |2020/11/17 09:00:00.002 | selectCount Start | |2020/11/17 09:00:00.003 | selectCount end | |2020/11/17 09:00:00.001 | Function:Count end | _________________________________________________