npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@edx/frontend-logging

v3.0.1

Published

Frontend logging client code for sending logging and events to New Relic

Downloads

13

Readme

frontend-logging

|Build Status| |Coveralls| |npm_version| |npm_downloads| |license| |semantic-release|

frontend-logging contains a shared interface for logging errors and event to New Relic.

Usage

To install frontend-logging into your project::

npm i --save @edx/frontend-logging

To configure the logging service::

import { configureLoggingService, NewRelicLoggingService } from '@edx/frontend-logging';

// configure with any concrete implementation that implements the expected interface
configureLoggingService(NewRelicLoggingService);

To use the configured logging service::

import { logApiClientError, logInfo, logError } from '@edx/frontend-logging';

logInfo(message);
logApiClientError(e, customAttributes);  // handles errors or axios error responses
logError(e);

NewRelicLoggingService

The NewRelicLoggingService is a concrete implementation of the logging service interface that sends messages to NewRelic that can be seen in NewRelic Browser and NewRelic Insights. When in development mode, all messages will instead be sent to the console.

When you use logError or logApiClientError, your errors will appear under "JS errors" for your Browser application.

Additionally, when you use logApiClientError, you get some additional custom metrics for Axios error responses. To see those details, you can use a New Relic Insights query like the following::

SELECT * from JavaScriptError WHERE errorStatus is not null SINCE 10 days ago

When using logInfo, these only appear in New Relic Insights when querying for page actions as follows::

SELECT * from PageAction WHERE actionName = 'INFO' SINCE 1 hour ago

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

.. |Build Status| image:: https://api.travis-ci.org/edx/frontend-logging.svg?branch=master :target: https://travis-ci.org/edx/frontend-logging .. |Coveralls| image:: https://img.shields.io/coveralls/edx/frontend-logging.svg?branch=master :target: https://coveralls.io/github/edx/frontend-logging .. |npm_version| image:: https://img.shields.io/npm/v/@edx/frontend-logging.svg :target: @edx/frontend-logging .. |npm_downloads| image:: https://img.shields.io/npm/dt/@edx/frontend-logging.svg :target: @edx/frontend-logging .. |license| image:: https://img.shields.io/npm/l/@edx/frontend-logging.svg :target: @edx/frontend-logging .. |semantic-release| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg :target: https://github.com/semantic-release/semantic-release