@tadashi/winston-datadog-transport
v1.1.0
Published
Custom transport for Winston.
Downloads
4
Maintainers
Readme
winston-datadog-transport
Custom transport for Winston.
Install
$ npm i -S @tadashi/winston-datadog-transport
API
DDTransport( [options]): TransportStream
Type: TransportStream
options
Type: object
Default: {}
Name | Type | Default | Required ----------- | --------- | ----------------- | ------------ DD_HOST | string | http-intake.logs.datadoghq.com | no DD_PATH | string | /v1/input | no DD_TAGS | string | - | no DD_KEY | string | - | yes
Usage
import winston from 'winston'
import DDTransport from '@tadashi/winston-datadog-transport'
const {
createLogger,
config,
format,
} = winston
const opts = {
levels: config.syslog.levels,
exitOnError: false,
format: format.json(),
}
const logger = createLogger({...opts, transports: [new DDTransport({
DD_KEY: 'cbadf2...',
})]})
logger.log({
level: 'info',
message: 'Apenas um show'
})
License
MIT © Thiago Lagden