Skip to content

edx/frontend-logging

frontend-logging

Build Status Codecov license

Purpose

frontend-logging contains a shared interface for logging errors and events to Datadog.

Usage

To install frontend-logging into your project::

npm i --save @edx/frontend-logging

To configure the logging service

In the env.config.js file, add the following

import { DatadogLoggingService } from '@edx/frontend-logging';

const config = {
  loggingService: DatadogLoggingService,
};

export default config;

DatadogLoggingService

The DatadogLoggingService is a concrete implementation of the logging service interface that sends messages to Datadog that can be seen in Datadog RUM and Datadog browser logs. When in development mode, all messages will instead be sent to the console.

When you use logError, your errors will appear under broswer logs for your Browser application.

You can also add your own custom metrics as an additional argument, or see the code to find other standard custom attributes.

General Logging service interface is defined in frontend-platform.