Skip to main content

BeforeSend

Type Alias BeforeSend 

Source
pub type BeforeSend = Arc<dyn Fn(Event) -> Option<Event> + Send + Sync>;
Expand description

A before_send hook: final-mile filter run on the calling thread before an event is queued. Return Some(event) (possibly mutated) to send, or None to drop.

Notes:

  • The min_level gate runs before this hook (events below the threshold are never built), so changing event.level here does not re-open the gate. None is the only way the hook drops an event.
  • On panic, behaviour follows Config::before_send_fail_open: by default the event is dropped (fail-closed), so a scrubber bug can’t leak the un-scrubbed original.

Aliased Type§

pub struct BeforeSend { /* private fields */ }