-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Description
FileLogger should send logs to a BackgroundService because ILogger is not meant to do IO operations.
Related issue:
dotnet/extensions#2141
Related discussion:
dotnet/runtime#87949
Concerned code
Gains
- Better performance, logging would not block the app thread writing to the file
- Separations of concerns,
ILoggeris meant just to log the information, another class needs to do the heavy job
Requirements
- Removing the IO operations from
ILogger - Create a
BackgroundServiceto run the IO operations requested by a buffer
Comments
Example FileLogger implementation:
https://github.com/JJConsulting/JJMasterData/blob/main/src/Commons/Logging/File/FileLogger.cs
Example FileLogger background service:
https://github.com/JJConsulting/JJMasterData/blob/main/src/Commons/Logging/File/FileLoggerBackgroundService.cs
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done