Socket
Socket
Sign inDemoInstall

@datadog/browser-logs

Package Overview
Dependencies
3
Maintainers
1
Versions
246
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
Maintainers
1
Install size
1.21 MB
Created

Changelog

Source

v4.50.0

  • ✨ [RUM-1062] add a prefix to all console message displayed by the SDK (#2432)
  • ✨ [extension] add columns to the event list (#2372)
  • ✨ [extension] revamp event description and JSON viz (#2371)
  • ✨ [extension] revamp filter UI (#2370)
  • ✨ [extension] filter outdated events (#2369)
  • 🐛 [RUM-1085] Remove lock usage from Local Storage strategy (#2435)
  • ♻️ rename scroll fields (#2439)
  • 🔇 Remove cwv attribution telemetry
  • ♻️ [RUM-1039] Harmonize view tests (#2430)
  • Report scroll metrics when page is resized (#2399)
  • ♻️ [RUM-253] adapt transport to send encoded data (#2415)
  • 🔊 [RUM-253] customize deflate worker failure logs (#2414)
  • ♻️ Use performance entry fixtures in tests (#2428)
  • ⚗️ [RUM-1020] Collect core web vitals target selectors (#2418)

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 26 Sep 2023

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