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
fix(node): Make log flushing logic more robust (#15991)
resolves https://linear.app/getsentry/issue/LOGS-18
We got some user feedback that nodejs logging was too inconsistent. This
PR improves that.
1. Add a new `flushLogs` client hook that allows us to reset server
weight tracking logic more consistently. This also fixes a bug where we
didn't reset weight tracking when calling `Sentry.flush`.
2. Add a `process.on('beforeExit'` listener to flush logs. Hooking onto
`beforeExit` does not guarantee we flush all logs before exit, but it
does increase the chances we do.
4. Add an idle timeout that will flush logs after 5 seconds if no new
logs are recorded. This should not leak memory because it is not an
interval, but instead a timeout.
0 commit comments