New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

logger-tracker

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logger-tracker

tracks and logs

  • 0.0.15
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

Logger tracker

Event tracking and logging

Tracker

Exports a TRACKER variable

Usage

import { initTracker, TRACKER } from 'request-tracker';

// initialize the tracker
requestTracker.initTracker(options);

// call track wherever you want to track events
requestTracker.TRACKER.track(options);

Functions

####initTracker(options) Initializes the TRACKER constant with supplied options Supports the following options:

version (string): version of the application you're tracking

url (string): The URL that the event logs will be posted to

context (string): a map of tracker-wide context values that will be added to each event

####TRACKER.track(options) Can be called inside routes or middleware functions with option values being functions of request objects (and additional middleware functions like morgan). These options will be added to the event entry. Supports the following options:

eventType (string): required type of event you're tracking for example 'login'

metric (string): required The name of the metric you're tracking

value (number): required The value of the metric you're tracking

user ({[k: string]: v: any}): JSON representation of a user on which you can specify attribute that will be written to the resulting event entry. Currently supported attribute are id and email

attr ({[k: string]: v: string}): Maps custom attribute names to string properties.

Logger

A small utility that ensures this is bound to the console object. Exports a LOGGER variable to interface with.

Usage

import { initLogger, LOGGER } from 'request-tracker';

initLogger();

LOGGER.log('hello');
LOGGER.warn('warning');
LOGGER.error('error');

FAQs

Package last updated on 12 Aug 2016

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc