Skip to content

feat(logs): add documentation for log_flush_threshold#17166

Merged
Litarnus merged 3 commits intomasterfrom
php-log-flush-threshold
Apr 1, 2026
Merged

feat(logs): add documentation for log_flush_threshold#17166
Litarnus merged 3 commits intomasterfrom
php-log-flush-threshold

Conversation

@Litarnus
Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview, Comment Apr 1, 2026 8:37am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview Apr 1, 2026 8:37am

Request Review


<SdkOption name="log_flush_threshold" type='int|null' defaultValue='null'>

Set this to a positive integer to flush buffered logs automatically after that many logs have been added. When `null`, the SDK does not auto flush buffered logs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set this to a positive integer to flush buffered logs automatically after that many logs have been added. When `null`, the SDK does not auto flush buffered logs.
Set this to a positive integer to flush buffered logs automatically after that many logs have been added. When set to `null`, the SDK does not auto flush buffered logs.


For example, if this is set to `5`, the SDK flushes when the fifth buffered log is added. After that call completes, the buffer is empty and new logs start a new batch.

This is mainly useful when a single request or job produces a lot of log lines, so flushing only at the end is not feasible.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is mainly useful when a single request or job produces a lot of log lines, so flushing only at the end is not feasible.
This is especially useful for requests or jobs that generate a high volume of logs, where waiting until the very end to flush isn’t practical.


## Logs

To send Laravel logs to Sentry, enable logs in your `.env` file or in `config/sentry.php`. If a single request, command, or job can produce a lot of log lines, `SENTRY_LOG_FLUSH_THRESHOLD` lets the SDK send partial batches before it finishes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To send Laravel logs to Sentry, enable logs in your `.env` file or in `config/sentry.php`. If a single request, command, or job can produce a lot of log lines, `SENTRY_LOG_FLUSH_THRESHOLD` lets the SDK send partial batches before it finishes.
To send Laravel logs to Sentry, enable logs in your `.env` file or in `config/sentry.php`. If a single request, command, or job can produce a high volume of logs, `SENTRY_LOG_FLUSH_THRESHOLD` lets the SDK send partial log batches before it finishes.


## Automatic Log Flushing

Laravel already flushes the Sentry log handler when a request, command, or job finishes. If a single request, command, or job can produce a lot of log lines, set `SENTRY_LOG_FLUSH_THRESHOLD` to send partial batches before it completes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Laravel already flushes the Sentry log handler when a request, command, or job finishes. If a single request, command, or job can produce a lot of log lines, set `SENTRY_LOG_FLUSH_THRESHOLD` to send partial batches before it completes.
Laravel already flushes the Sentry log handler when a request, command, or job finishes. If a single request, command, or job can produce a high volume of logs, set `SENTRY_LOG_FLUSH_THRESHOLD` to send partial log batches before it completes.

log_flush_threshold: 5
```

This is mainly useful when a single request or command produces a lot of log lines, so flushing only at the end is not feasible.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is mainly useful when a single request or command produces a lot of log lines, so flushing only at the end is not feasible.
This is especially useful for requests or jobs that generate a high volume of logs, where waiting until the very end to flush isn’t practical.


## Automatic Log Flushing

Symfony already flushes the Sentry log handler when a request or command finishes. If a single request or command can produce a lot of log lines, set `log_flush_threshold` to send partial batches before it completes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Symfony already flushes the Sentry log handler when a request or command finishes. If a single request or command can produce a lot of log lines, set `log_flush_threshold` to send partial batches before it completes.
Symfony already flushes the Sentry log handler when a request or command finishes. If a single request or command can produce a high volume of logs, set `log_flush_threshold` to send partial log batches before it completes.

Copy link
Copy Markdown
Contributor

@coolguyzone coolguyzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few rewording suggestions, but overall looks good! Thanks for adding.

@Litarnus Litarnus merged commit 9428ab9 into master Apr 1, 2026
18 checks passed
@Litarnus Litarnus deleted the php-log-flush-threshold branch April 1, 2026 08:47
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.

2 participants