An instance of ILogger is passed as an argument to the function invocation. You can use extension methods from Microsoft.Extensions.Logging to log events using the log instance.
run.csx
using System;
public static void Run(TimerInfo myTimer, ILogger log)
{
log.LogInformation("Log Information");
log.LogWarning("Log Warning");
log.LogError("Log Error");
log.LogDebug("Log Debug");
}
Sources:
https://www.serverlessnotes.com/docs/logging-with-ilogger-in-azure-functions
Comments