Socket
Socket
Sign inDemoInstall

@datadog/browser-logs

Package Overview
Dependencies
3
Maintainers
1
Versions
245
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @datadog/browser-logs

Send logs to Datadog from web browser pages with the browser logs SDK.


Version published
Weekly downloads
696K
decreased by-12.12%
Maintainers
1
Install size
1.31 MB
Created
Weekly downloads
 

Changelog

Source

v5.12.0

  • ✨ [RUM-3546] Add support of PCI compliant intake for browser logs (#2648)
  • ✨ [RUM 3352] Extra resource event attributes to enable performance CWV troubleshooting (#2646)
  • ✨ [RUM-2885] Collect CSP disposition (#2635)
  • 🐛 [RUM-3440] Fix INP CSS selector computation
  • 🐛 [RUM-3502] fix fetch(url) tracing (#2642)
  • 🔧 Enforce snake case for event type properties (#2649)
  • 🔊 [RUM-3501] add tracking_consent to configuration telemetry (#2640)
  • 🔧 configure renovate to deduplicate subdependencies (#2643)

Readme

Source

Browser Log Collection

Send logs to Datadog from web browser pages with the browser logs SDK.

See the dedicated datadog documentation for more details.

Usage

After adding @datadog/browser-logs to your package.json file, initialize it with:

import { datadogLogs } from '@datadog/browser-logs'

datadogLogs.init({
  clientToken: '<DATADOG_CLIENT_TOKEN>',
  site: '<DATADOG_SITE>',
  forwardErrorsToLogs: true,
  sessionSampleRate: 100,
})

After the Datadog browser logs SDK is initialized, send custom log entries directly to Datadog:

import { datadogLogs } from '@datadog/browser-logs'

datadogLogs.logger.info('Button clicked', { name: 'buttonName', id: 123 })

try {
  ...
  throw new Error('Wrong behavior')
  ...
} catch (ex) {
  datadogLogs.logger.error('Error occurred', { team: 'myTeam' }, ex)
}

FAQs

Last updated on 18 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc