winston-datadog-browser
v1.0.13
Published
Send winston logs to Datadog via the browser logs SDK.
Downloads
4,672
Maintainers
Readme
winston-datadog-browser
Send winston logs from the browser to Datadog via the datadog browser logs SDK.
winston-transport
+ @datadog/browser-logs
Installation
npm install --save winston winston-datadog-browser
Usage
import { configure, format } from 'winston';
import { DatadogBrowserLogs } from 'winston-datadog-browser';
configure({
transports: [
new DatadogBrowserLogs({
clientToken: '<DATADOG_CLIENT_TOKEN>',
site: '<DATADOG_SITE>',
forwardErrorsToLogs: true,
sampleRate: 100,
}),
// Optionally, also log to browser console
new BrowserConsole({
format: format.simple(),
}),
],
});
Configuration
DatadogBrowserLogs
uses the same configuration interface as @datadog/browser-logs
. See the datadog initialization parameters for more details.