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

1.0.5 • Public • Published

Dynatrace Transport for LogLayer

NPM Version NPM Downloads TypeScript

A transport for the LogLayer logging library to send logs to Dynatrace using their Log Monitoring API v2.

Installation

npm install loglayer @loglayer/transport-dynatrace serialize-error

Quick Start

You will need an access token with the logs.ingest scope. See access token documentation for more details.

import { LogLayer } from 'loglayer'
import { DynatraceTransport } from "@loglayer/transport-dynatrace"

const log = new LogLayer({
  errorSerializer: serializeError,
  transport: new DynatraceTransport({
    url: "https://your-environment-id.live.dynatrace.com/api/v2/logs/ingest",
    ingestToken: "your-api-token",
    onError: (error) => console.error('Failed to send log:', error)
  })
})

log.info('Hello world')

Documentation

For more details, visit https://loglayer.dev/transports/dynatrace

Package Sidebar

Install

npm i @loglayer/transport-dynatrace

Homepage

loglayer.dev

Weekly Downloads

50

Version

1.0.5

License

MIT

Unpacked Size

15.9 kB

Total Files

9

Last publish

Collaborators

  • theo.gravity