-
Notifications
You must be signed in to change notification settings - Fork 473
Open
Labels
Description
Microsoft.Azure.Functions.Extensions brought us the first attempt of being able to configure custom logging providers in Functions. With the current solution (where I can inject an ILoggerProvider), I can configure functions to log everything to a single log output. I would like to be able to do much more advanced logging configuration, though. Being able to register multiple logging provider, decide which log levels goes into which logs, and other features like that, is an essential part of most applications today.
Ideally, logging would be configured like any other application using Microsoft.Extensions.Logging:
[assembly: FunctionsStartup(typeof(MyNamespace.Startup))]
namespace MyNamespace
{
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
...
builder.Services.AddLogging(logging =>
{
logging.AddConfiguration(config.GetSection("Logging"));
logging.AddConsole();
logging.AddDebug();
logging.AddEventSourceLogger();
});
}
}
}