gatsby-plugin-datadog-logs
v1.0.1
Published
Gatsby plugin to add Datadog logging to your site.
Downloads
5
Maintainers
Readme
gatsby-plugin-datadog-logs
Gatsby plugin to add Datadog log collection to your Gatsby site.
Learn more about Datadog here.
Install
npm install --save gatsby-plugin-datadog-logs
How to setup
// In your gatsby-config.js
plugins: [
{
resolve: "gatsby-plugin-datadog-logs",
options: {
clientToken: 'YOUR_CLIENT_TOKEN',
site: 'datadoghq.com',
sampleRate: 100,
enabled: !IS_DEV,
}
}
];
Options available are same as the Datadog initialization parameters. Additionally, the parameter enabled
(boolean) is available to programatically turn the plugin integration on/off.
How to use
datadogLogs
is available on the global window object, so you can use it like this:
datadogLogs.logger.info("Hello World!");