JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3643
  • Score
    100M100P100Q131860F
  • License MIT

Axiom.co transport for the LogLayer logging library.

Package Exports

  • @loglayer/transport-axiom

Readme

Axiom Transport for LogLayer

NPM Version NPM Downloads TypeScript

A transport for sending logs to Axiom.co with the LogLayer logging library.

Installation

npm install @loglayer/transport-axiom @axiomhq/js serialize-error loglayer

Usage

import { LogLayer } from 'loglayer';
import { serializeError } from 'serialize-error';
import { AxiomTransport } from '@loglayer/transport-axiom';
import { Axiom } from '@axiomhq/js';

// Create the Axiom client
const axiom = new Axiom({
  token: process.env.AXIOM_TOKEN,
  // Optional: other Axiom client options
  // orgId: 'your-org-id',
  // url: 'https://cloud.axiom.co',
});

// Create the LogLayer instance with AxiomTransport
const logger = new LogLayer({
  errorSerializer: serializeError,
  transport: new AxiomTransport({
    logger: axiom,
    dataset: 'your-dataset',
  }),
});

logger.info('Hello world');

Documentation

For configuration options and examples, visit https://loglayer.dev/transports/axiom