tripitaka-datadog
v5.1.0
Published
[![NPM version](https://img.shields.io/npm/v/tripitaka-datadog.svg?style=flat-square)](https://www.npmjs.com/package/tripitaka-datadog) [![NPM downloads](https://img.shields.io/npm/dm/tripitaka-datadog.svg?style=flat-square)](https://www.npmjs.com/package
Downloads
19
Readme
Tripitaka Datadog
Tripitaka Datadog provides a transport and processor for the Tripitaka logger, which are suitable for publishing logs to Datadog.
TL;DR
import { Level, Logger, transports } from 'tripitaka';
import { datadogTransport, datadogProcessor } from 'tripitaka-datadog';
const onError = (error: any) => {
// ...
}
const logger = new Logger({
processors: [datadogProcessor()],
transports: [
datadogTransport({
apiKey: <api-key>,
hostname: <host-name>,
service: <service>,
ddsource: <source>,
ddtags: <tags>,
intakeRegion: 'eu',
threshold: Level.INFO,
},
onError),
transports.stream(),
],
});
const book = {
title: 'Monkey',
author: "Wu Ch'eng-en",
ISBN10: '9780140441116',
};
const book = {
title: "Monkey",
author: "Wu Ch'eng-en",
ISBN10: "9780140441116",
};
logger.info("Retrieved book", { book });