Skip to content

feat(logs): add log_flush_threshold flag to trigger auto flush#2032

Merged
Litarnus merged 2 commits intomasterfrom
log-flush-threshold
Mar 23, 2026
Merged

feat(logs): add log_flush_threshold flag to trigger auto flush#2032
Litarnus merged 2 commits intomasterfrom
log-flush-threshold

Conversation

@Litarnus
Copy link
Contributor

@Litarnus Litarnus commented Mar 23, 2026

Adds an option to perform an threshold based flushing of buffered logs. By default, this options remains null and will only flush when the flush method is invoked.

Example:

\Sentry\init([
    'dsn' => '__YOUR_DSN__',
    'log_flush_threshold' => 2,
]);

\Sentry\logger()->info('test');
\Sentry\logger()->error('error'); // this line will trigger the flush

Note that the threshold will also apply if using the monolog handler since it funnels everything down to the LogsAggregator

@Litarnus Litarnus merged commit b423e88 into master Mar 23, 2026
46 checks passed
@Litarnus Litarnus deleted the log-flush-threshold branch March 23, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants