Star us on GitHub
Star
Menu

Logging in Pino.js

Learn how to set up highlight.io log ingestion for Pino.JS.
1
Set up your frontend highlight.io integration.

First, make sure you've followed the frontend getting started guide.

2
Install the relevant Highlight SDK(s).

Install @highlight-run/pino with your package manager.

# with npm npm install --save @highlight-run/pino
Copy
# with yarn yarn add @highlight-run/pino
Copy
# with pnpm pnpm add @highlight-run/pino
Copy
3
Setup the Pino HTTP transport.

The Pino HTTP transport will send JSON logs to highlight.io. Make sure to set the project and service query string parameters.

import pino from 'pino' const logger = pino({ level: 'info', transport: { targets: [ { target: '@highlight-run/pino', options: { projectID: '<YOUR_PROJECT_ID>', }, level: 'info', }, ], }, }) logger.info({ key: 'my-value' }, 'hello, highlight.io!')
Copy
4
Verify your backend logs are being recorded.

Visit the highlight logs portal and check that backend logs are coming in.