Socket
Book a DemoInstallSign in
Socket

@openobserve/browser-logs

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openobserve/browser-logs

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

0.2.11
latest
Source
npmnpm
Version published
Weekly downloads
4.9K
10.71%
Maintainers
2
Weekly downloads
 
Created
Source

Browser Log Collection

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

See the dedicated openobserve documentation for more details.

Usage

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

import { openobserveLogs } from '@openobserve/browser-logs'

openobserveLogs.init({
  clientToken: '<OPENOBSERVE_CLIENT_TOKEN>',
  site: '<OPENOBSERVE_SITE>',
  forwardErrorsToLogs: true,
  sessionSampleRate: 100,
})

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

import { openobserveLogs } from '@openobserve/browser-logs'

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

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

FAQs

Package last updated on 20 Jan 2024

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.