@loglayer/transport-axiom
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i @loglayer/transport-axiom

Homepage

loglayer.dev

Weekly Downloads

110

Version

1.0.2

License

MIT

Unpacked Size

50.4 kB

Total Files

9

Last publish

Collaborators

  • theo.gravity