Skip to main content

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

LevelValueBehavior
DEBUG10Batched, subject to sampling/rate limiting
INFO20Batched, subject to sampling/rate limiting
AUDIT30Batched, subject to sampling/rate limiting
WARN40Sent immediately, never sampled or rate limited
ERROR50Sent immediately, never sampled or rate limited
FATAL60Sent 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