Interface ApolloLoggerPluginOptions

Options for the ApolloLoggerPlugin() factory function.

Hierarchy

  • ApolloLoggerPluginOptions

Properties

cleanedVariableNames?: string[]

When a variable is passed through matching one of these names, its value is replaced with "[REDACTED]" in the logs. Since the plugin logs all parameters by default, this prevents accidentally logging personally identifiable or sensitive information.

idSize?: number

Size of PID when generated with nanoid. Default is 10, but can be reduced if it's too wide for your logs.

logger?: Logger<LoggerOptions>

The Pino Logger you wish to use for writing log messages. By default, the plugin will call pino() to instantiate a logger with default options.

nanoid?: (() => Promise<string>)

Type declaration

    • (): Promise<string>
    • Function for generating a NanoID for PIDs. By default this uses customAlphabet() to generate a hexadecimal string, but you can pass in a custom function here to generate it any way you want. This allows you to track request logs on busy servers, by searching for this ID you can see which "Started" and "Completed" messages belong to one another.

      Returns Promise<string>

path?: string

The path your server accepts GraphQL requests on. Typically this can be left at the default, /graphql, but is configurable here so your log messages make sense if you serve GraphQL on an alternative path.

Generated using TypeDoc