@loglayer/transport-dynatrace
v2.1.14
Published
Dynatrace transport for the LogLayer logging library.
Maintainers
Readme
Dynatrace Transport for LogLayer
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-errorQuick 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
