Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apollo-log

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-log

A logging extension for Apollo GraphQL Server

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
511
decreased by-24.63%
Maintainers
1
Weekly downloads
 
Created
Source
Apollo Server

tests cover size

apollo-log

A logging extension for the Apollo GraphQL Server

Please consider donating if you find this project useful.

apollo-server doesn't ship with any comprehensive logging, and instead offloads that responsiblity to the users and the resolvers or context handler. That can be inconvenient. This module provides uniform logging for the entire GraphQL request lifecycle, as provided by extension hooks in apollo-server. The console/terminal result of which will resemble the image below:

Requirements

apollo-log is an evergreen 🌲 module.

This module requires an Active LTS Node version (v10.0.0+).

Install

Using npm:

npm install apollo-log

Usage

Setting up apollo-log is straight-forward. Instantiate the extension, passing any desired options, and pass the extensions array to apollo-server.

const { ApolloLogExtension } = require('apollo-log');
const { ApolloServer } = require('apollo-server');

const options = { ... };
const extensions = [() => new ApolloLogExtension(options)];
const apollo = new ApolloServer({
  extensions,
  ...
});

Options

level

Type: String
Default: info

Specifies at which base level that log messages will be shown (typically info or debug). For more information please see the loglevelnext documentation.

mutate

Type: Function Default: (level, data) => {}

If specified, allows inspecting and mutating the data logged to the console for each message. The level parameter is one of info or debug.

prefix

Type: String
Default: apollo:

Specifies a prefix, colored by level, prepended to each log message.

timestamp

Type: Boolean

If true, will prepend a timestamp in the HH:mm:ss format to each log message.

Meta

CONTRIBUTING

LICENSE (Mozilla Public License)

Keywords

FAQs

Package last updated on 08 Apr 2020

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