Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
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
Weekly downloads
884K
increased by6.2%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

v5.19.0

  • 🐛 [RUM-4629] accept null as env/version/service (#2781)
  • 🐛 [RUM-4493] do not compute selectors for detached elements (#2766)
  • 🐛 [RUM-2720] Send logs without session id when session inactive (#2578)
  • 🐛 [RUM-1666] Don't set negative action loading time (#2764)
  • 🐛 [RUM-4434] fix timing matching for the same resource requested twice at the same time (#2747)
  • 🐛 [RUM-4436] fix detached node memory leak on CLS (#2749)
  • ✅ fix clearing cookies between tests (#2780)
  • 🔥 Cleanup experimental features (#2768)
  • ✏️ various comment fixes (#2760)

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 27 May 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