All Projects → shellscape → apollo-log

shellscape / apollo-log

Licence: MPL-2.0 license
A logging extension for the Apollo GraphQL Server

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to apollo-log

apollo-graphql-tutorial
Learning apollo graphql version 2.x with Node.js
Stars: ✭ 18 (-71.87%)
Mutual labels:  apollographql, apollo-server, apollo-graphql
typescript-graphql-postgres-boilerplate
Simple boilerplate integrated typescript, graphql, postgres and apollo server
Stars: ✭ 18 (-71.87%)
Mutual labels:  apollo, apollo-server, apollo-graphql
apollo-express-ts-server-boilerplate
No description or website provided.
Stars: ✭ 29 (-54.69%)
Mutual labels:  apollo, apollographql, apollo-server
kontent-boilerplate-express-apollo
Kontent Boilerplate for development of Express application using Apollo server and GraphQL.
Stars: ✭ 21 (-67.19%)
Mutual labels:  apollo, apollographql, apollo-server
github-react-native-apollo-graphql
📱 A GitHub mobile app built with React-Native and Apollo GraphQL
Stars: ✭ 24 (-62.5%)
Mutual labels:  apollo, apollographql, apollo-graphql
now-course
Proyecto para el curso de Now.sh en Platzi
Stars: ✭ 19 (-70.31%)
Mutual labels:  apollo, apollographql, apollo-server
ng-logger
Angular logger service
Stars: ✭ 65 (+1.56%)
Mutual labels:  log, logger
hasura-node-monolith-example
Example of a monolithic web application using Hasura GraphQL Engine + Node.js + Next.js
Stars: ✭ 25 (-60.94%)
Mutual labels:  apollo, apollo-graphql
apollo-newrelic-extension
Apollo Server extension library for performing NewRelic transaction traces of graphql requests
Stars: ✭ 16 (-75%)
Mutual labels:  apollographql, apollo-server
JJSwiftLog
Swift log library for all platform
Stars: ✭ 51 (-20.31%)
Mutual labels:  log, logger
Portara
Portara directive is a rate limiter / throttler for GraphQL
Stars: ✭ 158 (+146.88%)
Mutual labels:  apollo, apollo-server
LogDNA-Android-Client
Android client for LogDNA
Stars: ✭ 22 (-65.62%)
Mutual labels:  log, logger
fullstack-apollo-subscription-example
A minimal Apollo Server 2 with Apollo Client 2 with Subscriptions application.
Stars: ✭ 72 (+12.5%)
Mutual labels:  apollographql, apollo-server
log
Aplus Framework Log Library
Stars: ✭ 14 (-78.12%)
Mutual labels:  log, logger
datalogger
DataLogger foi projetado para ser uma biblioteca simples de log com suporte a vários providers.
Stars: ✭ 46 (-28.12%)
Mutual labels:  log, logger
future-of-gql-servers
The future of GraphQL servers (GraphQL Europe 2018)
Stars: ✭ 27 (-57.81%)
Mutual labels:  apollo, apollo-server
Sqldatasource
SQL DataSource for Apollo GraphQL projects
Stars: ✭ 176 (+175%)
Mutual labels:  apollo, apollo-server
bookshelf
My GraphQL playground
Stars: ✭ 64 (+0%)
Mutual labels:  apollo, apollo-server
sprout
Golang logging library supporting log retrieval.
Stars: ✭ 85 (+32.81%)
Mutual labels:  log, logger
ios-graphql
iOS code examples with GraphQL, Apollo & more
Stars: ✭ 78 (+21.88%)
Mutual labels:  apollo, apollographql
Apollo Server

tests cover size

apollo-log

A logging plugin for Apollo GraphQL Server

❤️ Please consider Sponsoring my work

apollo-server doesn't ship with any comprehensive logging, and instead offloads that responsiblity to the users and the resolvers or context handler This module provides uniform logging for the entire GraphQL request lifecycle, as provided by plugin 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.23.1+).

Install

Using npm:

npm install apollo-log

Usage

Setting up apollo-log is straight-forward. Import and call the plugin function, passing any desired options, and pass the plugin in an array to apollo-server.

import { ApolloLogPlugin } from 'apollo-log';
import { ApolloServer } from 'apollo-server';

const options = { ... };
const plugins = [ApolloLogPlugin(options)];
const apollo = new ApolloServer({
  plugins,
  ...
});

Please see the Apollo Plugins documentation for more information.

Options

events

Type: Record<string, boolean>
Default:

{
  didEncounterErrors: true,
  didResolveOperation: false,
  executionDidStart: false,
  parsingDidStart: false,
  responseForOperation: false,
  validationDidStart: false,
  willSendResponse: true
}

Specifies which Apollo lifecycle events will be logged. The requestDidStart event is always logged, and by default didEncounterErrors and willSendResponse are logged.

mutate

Type: Function Default: (data: Record<string, string>) => Record<string, string>

If specified, allows inspecting and mutating the data logged to the console for each message.

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)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].