2.1.0 • Published 10 months ago

@loglayer/transport-axiom v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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

2.1.0

10 months ago

2.0.4

12 months ago

2.0.3

12 months ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago