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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@est-normalis/simple-apollo-logger

v0.5.2

Published

A simple logger for Apollo Server

Downloads

47

Readme

@est-normalis/simple-apollo-logger

npm version

A very simple logger for Apollo Server

Warning simple-apollo-logger is in alpha version.

Installation

yarn

yarn add @est-normalis/simple-apollo-logger

npm

npm i @est-normalis/simple-apollo-logger

Usage

To use this package you need to add plugin or extension (not recommended) to your ApolloServer

Plugin

[...]
import { apolloLogPlugin } from '@est-normalis/simple-apollo-logger'

const server = ApolloServer({
    plugins: [apolloLogPlugin()],
})

Extension (deprecated)

[...]
import logger from '@est-normalis/simple-apollo-logger'

const server = ApolloServer({
    extensions: [() => new logger()],
    [...]
})

Now you will be able to see logs in your console.

Configuration

Simple-apollo-logger is highly customizable. You can pass options to it when creating it's object.

Plugin configuration

[...]

const opts = {
    logger = customLogger
    logRequests = false
}

[...]
    plugins: [apolloLogPlugin(opts)],
[...]

Extension configuration

[...]

const opts = {
    logger = customLogger
    logRequests = false
}

[...]
    extensions: [() => new logger(opts)],
[...]

The options object will be merged with default settings and used by logger.

Available options

Types of all options are available for typescript users via UserOptions interface.

logger

logger is a function which is called with a parameter containing prepared strings with data.

logRequests

logRequests enables request logging.

logResponses

logResponses enables respons logging.

prefix

prefix is a method executed before every log, which by default returns timestamp.

variableFilter

variableFilter in a settings object for filtering GraphQL variables content before logging it. It is using recursive search inside object to find even nested variables with matching name.

Filter usage

It is the default filter included in this extension:

variableFilter: {
        keywords: ["password"],
        replacementText: "[FILTERED]"
}

You can replace it with false value if you want to disable it.

ignoreSchemaRequest

ignoreSchemaRequest allows you to ignore requests with name "IntrospectionQuery" which are usually requests fetching schema file.

Warning: you should not use this option in production since you can't be sure if query with this name is really fetching the schema.

Updating

0.4.x to 0.5.x

Version 0.5 introduces usage of new plugin API. Using plugin instead of extension is highly recommended, but not obligatory.

To use new plugin API change delete your logging extension from server initialization:

const server = ApolloServer({
    extensions: [() => new logger()], // remove this line
    [...]
})

Change default import to apolloLogPlugin named import:

before:

import logger from '@est-normalis/simple-apollo-logger'

after

import { apolloLogPlugin } from '@est-normalis/simple-apollo-logger'

and use it in server initialization

const server = ApolloServer({
    plugins: [apolloLogPlugin()],
    [...]
})

Possible configuration options are not changed from version 0.4.

0.3.x to 0.4.x

This update should not result in major changes except for not logging headers anymore reson. In this update TypeScript type definitions were also added (they replaced any type in requestDidStart function), but it should not change way of how is the logger working.

Prefix

Default prefix was changed from:

;`[${Date.now()}]`

to:

;`[${Date.now()}] `

Output from logger with default options should remain the same, however space between prefix and message was moved from concatenation of these strings to prefix itself.

0.2.x to 0.3.x

Logger

logger is no longer an object responding to .log method, so if you are using custom logger object you need to replace it with custom logger method.

Example:

0.2.x:

const opts = {
  logger: customLogger // customLogger has .log() method
}

0.3.x:

const opts = {
  logger: msg => customLogger.log(msg)
}

If you were not using custom logger this update should not make any major changes.