loglevel-datadog
v1.2.7
Published
loglevel plugin to send logs from the browser to Datadog via the datadog browser logs SDK
Downloads
40
Maintainers
Readme
loglevel-datadog
Send loglevel logs from the browser to Datadog via the datadog browser logs SDK.
loglevel
+ @datadog/browser-logs
Note that adding plugins to loglevel will show log output line numbers as coming from inside the plugin.
Installation
npm install --save loglevel-datadog
Usage
import log from 'loglevel';
import { loglevelDatadog } from 'loglevel-datadog';
loglevelDatadog(log, {
clientToken: '<DATADOG_CLIENT_TOKEN>',
site: '<DATADOG_SITE>',
forwardErrorsToLogs: true,
sampleRate: 100,
});
log.warn('hello datadog');
Configuration
loglevelDatadog
uses the same configuration interface as @datadog/browser-logs
. See the datadog initialization parameters for more details.