Skip to main content

Server-side Logging

By default on production deployments, console.log (and friends) will not output anything on the server side. This can make it difficult to debug production-only issues, so for server-side logging you can utilize the @acromedia/gesso-logger package. It wraps pino with the ability to configure it using environment variables.

The logger is already implemented for each of the Gesso middleware packages.

Env Variables

VariableDescriptionDefault
GESSO_LOGGER_LOG_LEVELSet the log level for the logger. Refer to pino docs for more info.info
GESSO_LOGGER_PRETTYSet to true to enable pretty loggingfalse

Usage

import logger from "@acromedia/gesso-logger";

logger.info("This is an info message");
logger.error("This is an error message");