Creates a sampling filter for high-throughput scenarios.
Only a fraction of events at the specified levels are kept, reducing log volume without losing visibility at higher severity levels.
sampling rates per log level (0–1)
a LogFilter that randomly samples events
LogFilter
const filter = samplingFilter({ debug: 0.01, trace: 0.001 });// Keeps 1% of debug events, 0.1% of trace events Copy
const filter = samplingFilter({ debug: 0.01, trace: 0.001 });// Keeps 1% of debug events, 0.1% of trace events
Creates a sampling filter for high-throughput scenarios.
Only a fraction of events at the specified levels are kept, reducing log volume without losing visibility at higher severity levels.