winston-datadog-formatter
v1.0.1
Published
Winston formatter for logging to DataDog
Downloads
4
Readme
winston-datadog-formatter
Formatting Winston logging for DataDog processing and storage
Installation
npm install --save winston-datadog-udp-transport
Example
The following example configures the Winston logger to use the DataDog formatter, and UDP transport to ship logs to DataDog via a local installation of the DataDog agent with UDP enabled. For more information on using UDP log shipping with the DataDog agent see winston-datadog-udp-transport
const winston = require('winston');
const DatadogTransport = require('datadog-transport');
const datadogFormatter = require('datadog-formatter');
const logger = winston.createLogger({
level: 'verbose',
transports: [
// Use the default transport configuration for a local
// install of the DD agent
new DatadogTransport({
format: datadogFormatter.format(),
})
]
});