Skip to content

refactor(logger): implement dynamic logger flushing with error handling #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kikobeats
Copy link

@Kikobeats Kikobeats commented Jul 3, 2025

When Axiom runs on Vercel, it can take advantage of waitUntil to avoid penalising the response time and flush the logger in the background.

On this PR:

  • Introduced the showErrors configuration option to control error visibility during logger flushing.
  • Added a helper function flushLogger to manage logger flushing based on the runtime environment (Vercel or not).
  • Updated the logger flush calls in route handlers to utilise the new flushLogger function, allowing for optional error display.

- Added a helper function `flushLogger` to manage logger flushing based on the runtime environment (Vercel or not).
- Updated the logger flush calls in route handlers to utilize the new `flushLogger` function, allowing for optional error display.
- Introduced `showErrors` configuration option to control error visibility during logger flushing.
Copy link

vercel bot commented Jul 3, 2025

@Kikobeats is attempting to deploy a commit to the AxiomFM Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant