© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
2 replies
Simon

❔ Fire and forget, do I need a new logger?

I'm working on a small fire & forget background task initiated from asp.net. Essentially following this: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/best-practices?view=aspnetcore-6.0#do-not-capture-services-injected-into-the-controllers-on-background-threads
I am creating a new scope & requesting a new dbcontext.
The question I have is: I want to do some logging as well, do I need to request a new ILogger/ILoggerFactory from the
scope.ServiceProvider
scope.ServiceProvider
or can I use the ILogger that is DI'd to the Controller?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Fire and forget
C#CC# / help
3y ago
❔ Can I Fire and forget ALOT of tasks? If so how do i do this efficiently?
C#CC# / help
3y ago
❔ Zenject (Unity) doesn't fire when i do new()
C#CC# / help
3y ago
Best logging library that supports working within "fire and forget" Task code
C#CC# / help
2y ago