Pino Transport Integration
Send structured logs from Node.js applications directly to Radianz
Overview
What is the Pino Transport?
The @pgms/radianz-pino-transport package is a Pino transport that sends structured logs directly to the Radianz platform over HTTP. It uses the same ingestion endpoint as the Serilog sink, so your Node.js logs appear alongside your .NET logs in the same dashboard — no intermediate collector required.
How it works
Installation
Install the npm package from npmjs.com
Step 1 — Install the package
Install the transport and Pino from npm. Node.js 18 or later is required:
npm install @pgms/radianz-pino-transport pinoConfiguration
Set up the transport with your Radianz credentials
Basic Usage
Create a Pino logger with the Radianz transport. Replace the endpoint, clientId and apiKey with your actual credentials:
import pino from "pino";
import { radianzTransport } from "@pgms/radianz-pino-transport";
const logger = pino(
{ level: "info" },
radianzTransport({
endpoint: "https://your-radianz-instance/api/v1/logs/batch",
clientId: "YOUR_CLIENT_ID",
apiKey: "YOUR_API_KEY",
serviceName: "my-node-service",
})
);
logger.info({ userId: "user-42" }, "User signed in");
logger.error(new Error("Something broke"), "Unhandled error");clientId is the App's Client ID and your apiKey is the API Token.Console + Radianz (multistream)
To send logs to both the console and Radianz simultaneously, use Pino's built-in multistream:
import pino from "pino";
import { multistream } from "pino";
import { radianzTransport } from "@pgms/radianz-pino-transport";
const radianz = radianzTransport({
endpoint: process.env.RADIANZ_ENDPOINT,
clientId: process.env.RADIANZ_CLIENT_ID,
apiKey: process.env.RADIANZ_API_KEY,
serviceName: "my-service",
});
const logger = pino(
{ level: "trace" },
multistream([
{ stream: process.stdout, level: "trace" },
{ stream: radianz, level: "trace" },
])
);Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
endpoint | string | — | Radianz batch endpoint URL (required) |
clientId | string | — | Client ID for authentication (required) |
apiKey | string | — | API key for authentication (required) |
serviceName | string | "" | Service name added to every log entry |
batchSize | number | 50 | Number of logs per batch before sending |
flushIntervalMs | number | 5000 | Maximum time (ms) before flushing the batch |
maxRetries | number | 3 | Maximum number of retry attempts on failure |
maxQueueSize | number | 10000 | Maximum queue size — oldest logs are dropped when full |
Sample Project
Try it locally with the included demo
A runnable sample project is included in the repository. It sends test logs at all levels (trace through fatal) with structured data, errors, and cause chains:
cd sdk/js/radianz-pino-transport
# 1. Copy and fill in your credentials
cp sample/.env.example sample/.env
# Edit sample/.env with your endpoint, clientId, apiKey
# 2. Run the demo
npm run sample