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
875K
increased by10.56%
Maintainers
1
Install size
1.30 MB
Created
Weekly downloads
 

Changelog

Source

v5.10.0

  • ✨ [RUM-2902] Add error causes to context when logging an error (#2602)
  • ✨ [RUM-3151] Report bundle sizes to logs (#2605)
  • ✨ [RUM-160] Collect PerformanceResourceTiming.responseStatus (#2587)
  • 🐛 [RUM-3039] Fix missing pending mutations at view end (#2598)
  • ⚗️[RUM-3235] collect vital.name attribute (#2609)
  • ⚗️[RUM-2889] custom vitals improvements (#2606)
  • 🔧 ignore karma-webpack for now (#2604)
  • ⚗️[RUM-2889] Bootstrap custom vital APIs (#2591)
  • ⚗ ️✨ [RUM-2445] implement Tracking Consent management (#2589)

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 Feb 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