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
Your Node.js App
Pino Transport
Radianz
Automatic batching by size and time interval
Automatic mapping from Pino to Radianz format
Exponential backoff retry with jitter
Error serialization with cause chain support
FIFO queue with configurable drop policy
Graceful shutdown with flush
Why direct integration?Unlike the OpenTelemetry approach that requires a Collector, this transport sends logs directly from your Node.js process to Radianz. This means zero infrastructure to maintain — just install the npm package and configure your API key. Ideal for serverless functions, small services, or any Node.js app.

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:

bash
npm install @pgms/radianz-pino-transport pino

Configuration

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:

javascript
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");
Where do I find my credentials?Go to Elmah > Log API Tokens in the Radianz dashboard. Your 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:

javascript
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
endpointstringRadianz batch endpoint URL (required)
clientIdstringClient ID for authentication (required)
apiKeystringAPI key for authentication (required)
serviceNamestring""Service name added to every log entry
batchSizenumber50Number of logs per batch before sending
flushIntervalMsnumber5000Maximum time (ms) before flushing the batch
maxRetriesnumber3Maximum number of retry attempts on failure
maxQueueSizenumber10000Maximum 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:

bash
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
What the demo sendsThe demo emits 9 logs covering all Pino levels (trace → fatal), including structured properties, JSON parse errors with stack traces, and a database error with a cause chain. Check your Radianz dashboard after running it.