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
| Variable | Description | Default |
|---|---|---|
| GESSO_LOGGER_LOG_LEVEL | Set the log level for the logger. Refer to pino docs for more info. | info |
| GESSO_LOGGER_PRETTY | Set to true to enable pretty logging | false |
Usage
import logger from "@acromedia/gesso-logger";
logger.info("This is an info message");
logger.error("This is an error message");