Installation
Install Pino using npm:Setup
Create a logger.js file
Create alogger.js file in your project root to centralize logger configuration:
- Sends logs to stdout (console)
- Routes logs to OpenTelemetry transport for integration with observability platforms
- Sets log level to “trace” to capture all events
Import and use in your app
In your mainapp.js, import the logger:
Log Levels
Pino supports the following log levels (in order of severity):fatal- Application is unusableerror- Error conditionwarn- Warning conditioninfo- Informational messagedebug- Debug messagetrace- Trace message (most verbose)