0.2.13 • Published 2 years ago

@lightspeed/apollo-logging-extension v0.2.13

Weekly downloads
530
License
MIT
Repository
-
Last release
2 years ago

@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,
});
0.2.13

2 years ago

0.2.9

2 years ago

0.2.8

3 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago