© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
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#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
❔ Fire and forget
C
C# / help
3y ago
❔ Can I Fire and forget ALOT of tasks? If so how do i do this efficiently?
C
C# / help
3y ago
❔ Zenject (Unity) doesn't fire when i do new()
C
C# / help
3y ago
Best logging library that supports working within "fire and forget" Task code
C
C# / help
2y ago