Skip to content

Conversation

@HugoRCD
Copy link
Owner

@HugoRCD HugoRCD commented Jan 27, 2026

This pull request introduces a new log sampling feature to the logging system, allowing users to configure what percentage of logs are kept per log level (info, warn, debug, error).
The sampling configuration is now supported throughout the logger, Nuxt, and Nitro integrations, and is fully documented and tested.
By default, error logs are always kept unless explicitly configured otherwise. This helps reduce log volume at scale while ensuring important logs are retained.

@HugoRCD HugoRCD self-assigned this Jan 27, 2026
@HugoRCD HugoRCD requested a review from Copilot January 27, 2026 22:26
@vercel
Copy link

vercel bot commented Jan 27, 2026

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

Project Deployment Review Updated (UTC)
evlog-docs Ready Ready Preview, Comment Jan 27, 2026 11:21pm

@github-actions
Copy link

github-actions bot commented Jan 27, 2026

Thank you for following the naming conventions! 🙏

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 27, 2026

npm i https://pkg.pr.new/evlog@9

commit: fea71ee

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds configurable log sampling (percentage-based per log level) to reduce log volume, and wires the configuration through the Nuxt/Nitro integration and documentation.

Changes:

  • Introduces SamplingConfig / SamplingRates types and exposes them from the public API.
  • Implements per-level head sampling in the server logger and passes sampling config through the Nitro plugin.
  • Adds docs + README updates and Vitest coverage for sampling scenarios.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/evlog/src/logger.ts Adds sampling logic (shouldSample) and applies it when emitting wide events.
packages/evlog/src/types.ts Defines SamplingConfig/SamplingRates and adds sampling to LoggerConfig.
packages/evlog/src/index.ts Re-exports sampling types from the package entrypoint.
packages/evlog/src/nuxt/module.ts Extends Nuxt module options to accept sampling.
packages/evlog/src/nitro/plugin.ts Plumbs runtime sampling config into initLogger().
packages/evlog/test/logger.test.ts Adds sampling-focused unit tests (0%, 100%, default error behavior, probabilistic sampling).
apps/docs/content/1.getting-started/2.installation.md Documents Nuxt sampling configuration and explains default error behavior.
README.md Updates usage/config examples to include sampling.
AGENTS.md Updates Nuxt configuration example/options table to include sampling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HugoRCD HugoRCD merged commit fe32de4 into main Jan 27, 2026
11 checks passed
@HugoRCD HugoRCD deleted the feat/sampling branch January 27, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants