Getting Started
pui-diagnostics is a framework-agnostic JavaScript library for logging messages from web applications, following ICEMT logging guidelines.
Quick Start
import {
logger,
http,
logUnhandledErrors,
webvitals,
} from '@elliemae/pui-diagnostics';
const appLogger = logger({
transport: http('https://int.api.ellielabs.com/diagnostics/v2/logging'),
index: 'myapp',
team: 'my team',
appName: 'Hello World App',
});
logUnhandledErrors(appLogger);
webvitals(appLogger);
appLogger.info('Application launched');
Log Levels
| Level | Value | Behavior |
|---|---|---|
DEBUG | 10 | Batched, subject to sampling/rate limiting |
INFO | 20 | Batched, subject to sampling/rate limiting |
AUDIT | 30 | Batched, subject to sampling/rate limiting |
WARN | 40 | Sent immediately, never sampled or rate limited |
ERROR | 50 | Sent immediately, never sampled or rate limited |
FATAL | 60 | Sent immediately, never sampled or rate limited |
The default log level is INFO. Messages below this threshold are not logged.
Next Steps
- Installation — CDN and npm setup
- Usage — Detailed examples, transport options, and API reference
- Features — Full feature list