Workaround for Add support for injecting the Function provided ILogger into own DI Framework #2720 using Microsoft.Extensions.DependencyInjection
.
The logger factory available in Microsoft.Azure.WebJobs.Host.Config.ExtensionConfigContext
has an ILoggerFactory
that has certain filter applied that only allow logging for a few categories related to functions. This example uses reflection to add your own custom categories to those filters so you can use the existing loggers available when you run a function and inject ILogger<>
instances in your custom code to do logging.