@axiomhq/logging
Version:
The official logging package for Axiom
33 lines (22 loc) • 802 B
Markdown
The `@axiomhq/logging` package allows you to send structured logs to Axiom from any JavaScript application.
```ts
// lib/axiom/logger.ts
import axiomClient from '@/lib/axiom/axiom';
import { Logger, ConsoleTransport, AxiomJSTransport } from '@axiomhq/logging';
export const logger = new Logger({
transports: [
new AxiomJSTransport({ axiom: axiomClient, dataset: process.env.AXIOM_DATASET! }),
new ConsoleTransport({ prettyPrint: true }),
],
});
logger.info('Hello World!');
```
```bash
npm install @axiomhq/js @axiomhq/logging
```
For more information about how to set up and use the `@axiomhq/logging` package, see the [axiom.co/docs/guides/javascript](https://axiom.co/docs/guides/javascript).
[](../../LICENSE)