Logfire Pino Transport
Get started with Pino transport in 3 easy steps.
1. Install
Install Logfire Pino NPM package:
npm install @logfire-sh/pino
2. Set up Logfire client:
Set up Pino logger with Logfire transport:
const token = `$SOURCE_TOKEN`;
const pino = require('pino');
const transport = pino.transport(
{
target: '@logfire-sh/pino',
options: { sourceToken: token }
});
const logger = pino(transport);
Replace
$SOURCE_TOKEN
with your source token. You can get your source tokens in your Logfire sources.
3. Start logging 🎉
logger.error('An Error Occured!!!');
logger.info('Structured logging message.', { obj: 'Superbike', color: 'pink'});
// Ensure that all logs are sent to Logfire
logfire.flush()
Pino version 7.0.0 or higher is required.Logfire Pino client supports Pino v7+ transports.
You should see your logs in Logfire → Live tail.