Skip to main content

Features

  • Logs unhandled errors and unhandled promise rejections
  • Logs messages to different targets: console, HTTP endpoint, or parent app module
  • Batches non-critical logs (DEBUG, INFO, AUDIT) and flushes on a configurable interval
  • Sends critical logs (WARN, ERROR, FATAL) immediately without batching
  • Rate limiting — cap the number of non-critical logs per interval window
  • Sampling — randomly sample a percentage of non-critical logs to reduce volume
  • Automatic flush on page unload (beforeunload, pagehide, visibilitychange)
  • Uses navigator.sendBeacon when available for batched and critical logs; if a batch is rejected, splits it in half and retries recursively, then uses fetch (keepalive) with retries when needed
  • Redacts PII (emails, SSNs, phone numbers, addresses, credit cards, passwords) from log messages
  • Logs Web Vitals (LCP, INP, CLS) metrics
  • Does not block unloading of the document or navigation of the webpage
  • Follows ICEMT logging guidelines
  • JS framework agnostic
  • Available as browser / npm module