-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More advanced log configuration #4405
Comments
We do not have plans to support custom logging providers in functions currently. @fabiocav, correct me if I am not right. |
That is actually supported with the new DI capabilities. We're working on more detailed documentation for this scenario |
@fabiocav It's perfectly fine to close this issue if it isn't something you are planning to work on. But for future views on this issue, I just want to point out that logging as described in the original question isn't supported with the current DI capabilities. Unless I've misunderstood something, you can only register a logger provider but not actually log to multiple locations, configure which log levels goes where, and all of the other features of Microsoft.Extensions.Logging. |
@ThomasArdal that's fair. A lot of what you've mentioned above is supported and we're lacking documentation on how to do that with what is currently exposed. Can you clarify your distinction between registering a logger provider and logging to multiple locations? I'll reopen that as requested so we can track the documentation updates and any other potential work. |
@fabiocav Great. I'll look out for the documentation. I was looking to do something like this, which either isnt't supported or I cannot get to work: builder.Services.AddLogging(logging =>
{
logging.AddConfiguration(config.GetSection("Logging"));
logging.AddConsole();
logging.AddDebug();
logging.AddEventSourceLogger();
}); |
Same here... can anyone show how to accomplish what @ThomasArdal is trying to do? Currently my logging is only going into app insights, but doesn't show up in the azure portal log window. I only see the built-in messages. |
Not to pile up on this issue, but I know that a function will accept an I am fine with the app insights-based |
Sorry I just noticed someone had posted about this over on the extensions repo where the DI extension lives: Azure/azure-functions-dotnet-extensions#10 |
Any news on an example using custom logging from Azure Functions? |
@fabiocav This issue can be closed (IMO). I got this working by changing the way my For anyone else interested in seeing how to configure a custom |
One thought - if we haven't added more detailed examples in the project / documentation on MS docs, then perhaps we can take several of the ones listed in this issue (as well as the IConfiguration issue I started), and put them in the project where most devs go to look? |
Some extended documentation would be nice. Also, if there are some additional requirements for how to implement a new |
Maybe someone around here can point us in the right direction of how to make this happen. Can we get one or two new issues created and label them as required documentation tasks. Then there we can discuss proper examples, and eventually get pull requests made out of them. |
Good idea. I think this issue should be closed once the new issues have been created. This issue signals that custom providers aren't supported, which is not the case 😄 |
Thank you, all! Will leave this open and flag this for follow up with @jeffhollan so we can prioritize documentation. |
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 anILoggerProvider
), 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:
The text was updated successfully, but these errors were encountered: