Socket
Socket
Sign inDemoInstall

@lightspeed/apollo-logging-extension

Package Overview
Dependencies
265
Maintainers
8
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lightspeed/apollo-logging-extension

Standard output logging extension for Apollo GraphQL services


Version published
Weekly downloads
7
increased by600%
Maintainers
8
Created
Weekly downloads
 

Readme

Source

@lightspeed/apollo-logging-extension

npm version

Introduction

Standard output logging extension for GraphQL services. Logs the request operation, query, arguments, errors, and tracing information overall and per field.

Quick Start

  1. Install the dependency in your webapp.
yarn add apollo-server-express @lightspeed/apollo-logging-extension
  1. Enable the extension and tracing in your Apollo server configuration. As a best practice, pass in the version and name of your service.
// server.ts
import ApolloLoggingExtension from '@lightspeed/apollo-logging-extension';

const { name, version } = require('./package.json');

const server = new ApolloServer({
  // ...
  extensions: [() => new ApolloLoggingExtension({ name, version })],
  tracing: true,
});
  1. Optionally, enable variables logging for debugging purpose. This is explicitely turned off by default to prevent logging sensible information going through the GraphQL layer:
// server.ts
import ApolloLoggingExtension from '@lightspeed/apollo-logging-extension';

const { name, version } = require('./package.json');

const server = new ApolloServer({
  // ...
  extensions: [
    () =>
      new ApolloLoggingExtension({
        name,
        version,
        logVariables: process.env.NODE_CONFIG_ENV === 'development',
      }),
  ],
  tracing: true,
});

FAQs

Last updated on 26 Apr 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc