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 🙏

© 2025 – Pkg Stats / Ryan Hefner

olo-logger

v0.1.1

Published

olo-logger is a loging service that provides a preconfigured logger as well as ready to use methods around common loging cases, to help you hit the ground runing.

Readme

olo-logger

olo-logger is a loging service that provides a preconfigured logger as well as ready to use methods around common loging cases, to help you hit the ground runing.

Installation

Navigate to your project folder and enter the following in you terminal:

npm i olo-logger --save

Usage

new OloLog().logger returns the included logger.

const logger = new OloLog().logger;
logger.info('Log this info-message!');

The logger provides methods to log messages with the following semantics:

  • debuging information: logger.debug('var reuestStatus value: '+ reuestStatus);
  • information about app processes: logger.info('Database startup completed.');
  • information about potentialy problematic app processes logger.warning('Requested content is not available.');
  • information about erroneus app processes logger.error('Request could not be completed.');
  • information about erroneus app state that keeps the app from runing fatal('Database is not avaialable.');

Request logging

olo-logo provides methods for logging read and write requests in humand readable format as well as JSON loging of relevant request metadata (see also Configuration).

Logging read requests

new OloLog().logReadRequest = (
  route, // request url
  query, // url and query parameters relevant for the read qeuery
  context, // object containing request methadata for JSON logging
  status, // http status code of the request
  execution, // duration of request handling
);

Logging write requests

new OloLog().logWriteRequest = (
  route, // request url
  query, // array of requested actions noted as `CREATE`, `UPDATE`, `DELETE`, `PUBLISH`, or a custom description of update
  context, // object containing request methadata for JSON logging.
  status, // http status code of the request
  execution, // duration of request handling
);

Configuration

olo-logger is implemented as a singleton to make sure there exists only one instance in any runing app. So the service needs to be configured at the first instantiation.

const log = new OloLog({
  logger: {
    logger: 'bunyan',
    env: 'production',
    name: 'myApp',
    path: '/app/logfiles/log.json',

    jsonFilter: 'Koa',
  },
  jsonFilter: {
    filter: 'Koa',
  },
});

If a reconfiguration at a later stage is needed the methods new OloLog().resetLogger(logger) and new OloLog().resetJsonFilter(jsonFilter) are available.

Configuration options overview

| Option | Description | Supported Values | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | | logger.logger | Either defines a included logger (currently only bunyan is supported) by identifier string or takes a logger that fits the olo logger interface (see Usage). | bunyan or logger instance | | logger.env | Sets the environment in which the app is runing and influences the amount of log output. This option overrides configurations done via the NODE_ENV or the OLO_APP_ENV environment variables. | development, production | | logger.name | An identifier or name of the logging application that will be part of the log messages. Defaults to OLO_APP. | any string | | logger.path | If provided, log messages will be writen to the indicated log file. If no path is provided logging to file is disabled. | file path string | | jsonFilter.filter | JsonFilter are functions that filter request meta data object down to the expected structure and scope for loging. JsonFilters for supported web frameworks can be enabled by identifier string (currently only the ctx object of the Koa framework is supported). Alternatively the a custom filter function can be provided here. | Koa or a filter function |