-
Making logging async would be very disruptive as it would mean every code path that calls logging would have to be async. It also means that the caller is likely blocked (even if via The recommendation here is to use background worker. This is even what the console logger does (even though it's all in-process). Any logger that does heavy I/O should consider adopting this pattern:
Originally posted by @analogrelay in dotnet/extensions#2141 (comment) Can anyone provide an example of the recommendation above? Is my implementation fine? FileLogger: FileLoggerBackgroundService: LoggerBackgroundService: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Consider using System.Text.Json instead of JSON.NET to serialize, did you measure the performance of this? |
Beta Was this translation helpful? Give feedback.
-
Hi @davidfowl ! First of all thanks for your response! Sorry for the late reply, I was on vacation.
|
Beta Was this translation helpful? Give feedback.
Consider using System.Text.Json instead of JSON.NET to serialize, did you measure the performance of this?