You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 await) waiting for the log message to be sent.
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:
The logger is synchronous and just adds messages to an internal buffer
A background IHostedService runs and collects messages from this buffer, flushing them to the I/O sink (remote service, console, file, etc.)
Problem
im use sentry logger. sentry Problems with a large number of requests.
Solution
add Ilogger async method. add log to queue and background insert log, like nlogger async warpper.
The text was updated successfully, but these errors were encountered: